-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Maintaining iCloud Storage Size #1046
Comments
Love this. I think this is a great way to meet the needs (demands? 😉 ) of the various requests, issues, and discussions around this.
I didn't know this is how it behaved, but it makes sense. I definitely support using the asset's presence in this way. Out of the options listed, I think B makes the most sense and is the most aligned with the current application. I think it would also allow for shipping parts of it sooner if desired. I've been working on another PR to allow keeping favorites in the cloud, but I was attempting to make it broader and enable users to specify an album to keep in the cloud, even if assets age out. I really only wanted it for favorites, which may behave differently anyway -- assets appear to have an To that end, I'd suggest following your convention with the third parameter: |
I completely missed the fact that all favorites are organized into smart album! We can have only |
Good call! I think that would work well. One other thought, do you want the parameters to be explicitly |
I think having a reference to a cloud is important in the param so it is absolutely clear that we are controlling remote, not local presence of the asset. I also looked at If there is another way to name params, let's explore. Confusing behavior (or misunderstanding of parameters) causes a lot of issues down the road. |
I think |
Edge cases:
|
for total size specifying units in the parameter should help avoid confusion too: For 5GB free tier, I assume users will have to specify lower value to allow new assets to be added to the iCloud. If we allow only ints for the size value, then for free tier users will have to leave 20% of the storage unused. I am leaning towards allowing floats as GB value to cover free tier use case better. |
I wonder if you might want to allow the unit to be specified instead? I'm mostly think about how the
Another thought: with |
Perfect! To summarize: |
@jhofker are you working or planning to work on other parts of this RFC? If I were to choose, |
I have a branch started for (FWIW, I'm not precious about it, so if you're wanting to tackle it, that's perfectly fine! Since the holiday break is over, my time will be limited to randoms evenings and weekends) |
Draft PR here: #1051 |
We missed one requirement: if |
Yes, good point! That's in the code and having it documented here is good. |
…r#1046, keep-icloud-* and auto-delete should not be used together either
… multiple times
[RFC] Maintaining iCloud Storage Size
This is a proposal to control the size of the iCloud storage by automatically deleting old assets already present on the local storage.
1. Context
Many iCloud users store their entire asset collection in the cloud and use the
icloudpd
tool to maintain a local copy. This approach can become less optimal with larger collections due to:It is also possible to use the iCloud as an temporary storage between iDevice and a local storage -
icloudpd
has--delete-after-download
parameter to control deletion of the iCloud assets as soon as they are downloaded to the local storage.The above are two extremes - "all assets premanently in the cloud" and "no assets permanently in the cloud". There has been a number of requests to support hybrid approach to control the cost of the iCloud service - to keep some assets in the iCloud, while deleteing others. This is the focus of the current proposal.
2. Problem Scope
To control the content of the iCloud storage, two priorities have been identified:
There is a need for exceptions, such as keeping certain assets (e.g., favorites) in the iCloud permanently. These exceptions will contribute to the total size calculation if applicable.
3. Assumptions
Local storage represents the final storage media for assets. Subsequent runs of the
icloudpd
agains local storage will check for asset presence and only download incremental changes.Timestamp when the assets was taken (aka "created date") as reported by the iCloud is used for calculating age. For example, asset taken in 2000, but added to the iCloud in 2024, will be 25 years old in 2025. Same timestamp is used for folder structure in the current system.
Assets may be represented in multiple variations, e.g. raw+jpeg, small+medium+original, image+video. Only some variations are counted towards the iCloud total size. Content of smart folders, including Recently Deleted, are not counted towards the total size. This is standard behavior of the iCloud.
4. Decisions
Asset Filters
Asset filters, e.g.
--skip-videos
, limit assets that are checked by theicloudpd
and only these checked assets are subject for deletion as part of storage maintenence. For example, runningicloudpd
with--skip-videos
on a huge iCloud collection of videos will download and delete nothing.Special whole set filters,
--recent
and--until-found
, will not be supported with the proposed iCloud storage maintenance mode.Asset Size Filters
Some assets have multiple representations ("sizes" in the
icloudpd
parameters):Deletion works at the asset level and all sizes will be removed from the iCloud.
When narrowing the scope of the
icloudpd
to only certain sizes, the rest of the sizes are not checked. For example, running for--size small
will download only small size and then delete whole assets regardless of the presence of other sizes in the local storage.Downloaded vs Existing Assets
Presence of the asset in the local storage has the same effect as downloading for the purpose of the iCloud storage maintenance. This is different from
--delete-after-downloading
parameter that deletes only after downloading, but not touching existing files.Default
--file-match-policy
ofname-size-dedup-with-suffix
is not expected to have negative impact on the behavior of the proposed iCloud storage maintenance (beyond known inconsistencies, e.g. in combination with--set-exif-datetime
).Incompatibilities
--auto-delete
parameter removes assets in the local storage if they were previously deleted in the iCloud. This functionality is not compatible with the proposed maintenance of the iCloud storage.Dates and Timezones
Calculation of the age of the assets is expected to take into account timezone offset from the asset itself and timezone of the system running
icloudpd
.5. Implementation Choices
Need mechanisms to specify:
(a) One Parameter to Control of What to Keep
New parameter
--keep-in-cloud
to control mode, spec, and exceptions. Parameter may be specified multiple times to provide non-conflicting values:(b) Multiple Parameters to Control of What to Keep
Multiple parameters to control mode, spec, and exceptions:
--keep-cloud-total-size
- enable size limiting mode and use "number" as a spec for size in GBs--keep-cloud-recent-days
- enable age limiting mode and use "number" as a spec for age in days--always-keep-favorites-in-cloud
- instruction to keep all favorites assets in the iCloud regardless of age or size; requires enabled limiting mode as wellIf niether
--keep-cloud-total-size
nor--keep-cloud-recent-days
are specified, then storage maintenance mode is turned off and nothing will be deleted from the iCloud.Recomendation
Use multiple parameters to control storage maintenance mode (option b), as it offers clearer user control.
The text was updated successfully, but these errors were encountered: