Skip to content

Commit 8855d13

Browse files
committed
Move swift-icloud-stats tool over to this repo
1 parent 2379ca5 commit 8855d13

File tree

9 files changed

+577
-7
lines changed

9 files changed

+577
-7
lines changed

README.md

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
### icloudbackup
1313

14-
*Copy files from iCloud Documents dir to another destination.*
14+
*Copy files from your iCloud Documents directory to another destination.*
1515

1616
```shell
1717
# Show help
@@ -33,9 +33,27 @@
3333
./icloudbackup --src "/Users/guenther/Downloads/" --dst "/Volumes/Black/icloud-documents-backup/"
3434
```
3535

36+
### icloudstats
37+
38+
*Show stats about your iCloud Documents directory*
39+
40+
```shell
41+
# Show help
42+
./icloudstats --help
43+
44+
# Show auto-detected documents directory
45+
./icloudstats --show-src
46+
47+
# Scan and show stats
48+
./icloudstats
49+
50+
# Scan and show stats of another directory
51+
./icloudstats --src "/Users/guenther/Downloads/"
52+
```
53+
3654
### iclouddownload
3755

38-
*Recursively download a directory below the iCloud Documents dir.*
56+
*Recursively download a directory below the iCloud Documents directory.*
3957

4058
```shell
4159
# Show help
@@ -50,7 +68,7 @@
5068

5169
### icloudoffload
5270

53-
*Recursively remove the local copies of a directory below the iCloud Documents dir.*
71+
*Recursively remove the local copies of a directory below the iCloud Documents directory.*
5472

5573
```shell
5674
# Show help
@@ -73,6 +91,10 @@ TODO: These are old.
7391

7492
![screenshot3](/screenshots/3.png?raw=true "Screenshot 3")
7593

94+
![screenshot4](/screenshots/4.png?raw=true "Screenshot 4")
95+
96+
![screenshot5](/screenshots/5.png?raw=true "Screenshot 5")
97+
7698
## Dependencies
7799

78100
- [swift-argument-parser](https://github.com/apple/swift-argument-parser) (flags and options)
@@ -82,9 +104,11 @@ TODO: These are old.
82104

83105
- Offloaded files only exist as a placeholder `*.plist` files on your drive
84106
- These files only have a few bytes
107+
- Because of this common filesystem usage tools like **DaisyDisk** are of no use to identify big files or get an overview about your actual storage usage
108+
- You need to analyze the content of the `*.plist` placeholder file along with real files
85109
- Because of this common backup tools like `rsync` are of no use, would just copy the placeholder
86-
- You need to download, backup and offload the real file
87-
- This tool does exactly that
110+
- You need to download, backup and offload the real file
111+
- These tools help with those issues
88112

89113
## Know Issues
90114

icloud-backup/icloud-backup.xcodeproj/project.pbxproj

Lines changed: 117 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,14 @@
2020
A4317FE126BA71610012CCA6 /* extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A408075026AAF3BE009FD4F4 /* extensions.swift */; };
2121
A4317FE226BA718E0012CCA6 /* file_operations.swift in Sources */ = {isa = PBXBuildFile; fileRef = A44447B326AC60C6004A4D4D /* file_operations.swift */; };
2222
A44447B426AC60C6004A4D4D /* file_operations.swift in Sources */ = {isa = PBXBuildFile; fileRef = A44447B326AC60C6004A4D4D /* file_operations.swift */; };
23+
A46598B926BC48300032651E /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = A46598B826BC48300032651E /* main.swift */; };
24+
A46598BE26BC48470032651E /* cli.swift in Sources */ = {isa = PBXBuildFile; fileRef = A46598BD26BC48470032651E /* cli.swift */; };
25+
A46598BF26BC484D0032651E /* placeholder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A408075426AAF3FD009FD4F4 /* placeholder.swift */; };
26+
A46598C026BC48500032651E /* extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A408075026AAF3BE009FD4F4 /* extensions.swift */; };
27+
A46598C126BC48520032651E /* file_operations.swift in Sources */ = {isa = PBXBuildFile; fileRef = A44447B326AC60C6004A4D4D /* file_operations.swift */; };
28+
A46598C326BC48960032651E /* walk.swift in Sources */ = {isa = PBXBuildFile; fileRef = A46598C226BC48960032651E /* walk.swift */; };
29+
A46598C526BC48D00032651E /* stats.swift in Sources */ = {isa = PBXBuildFile; fileRef = A46598C426BC48D00032651E /* stats.swift */; };
30+
A46598C726BC48DC0032651E /* ArgumentParser in Frameworks */ = {isa = PBXBuildFile; productRef = A46598C626BC48DC0032651E /* ArgumentParser */; };
2331
A490AB7926B9AA2A007C1120 /* Chalk in Frameworks */ = {isa = PBXBuildFile; productRef = A490AB7826B9AA2A007C1120 /* Chalk */; };
2432
A4A9A89626AAF1F900706A28 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4A9A89526AAF1F900706A28 /* main.swift */; };
2533
A4BCBAA326AD5F3500CE89F6 /* walk_src.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4BCBAA226AD5F3500CE89F6 /* walk_src.swift */; };
@@ -43,6 +51,15 @@
4351
);
4452
runOnlyForDeploymentPostprocessing = 1;
4553
};
54+
A46598B426BC48300032651E /* CopyFiles */ = {
55+
isa = PBXCopyFilesBuildPhase;
56+
buildActionMask = 2147483647;
57+
dstPath = /usr/share/man/man1/;
58+
dstSubfolderSpec = 0;
59+
files = (
60+
);
61+
runOnlyForDeploymentPostprocessing = 1;
62+
};
4663
A4A9A89026AAF1F900706A28 /* CopyFiles */ = {
4764
isa = PBXCopyFilesBuildPhase;
4865
buildActionMask = 2147483647;
@@ -73,6 +90,11 @@
7390
A4317FD826BA6D4A0012CCA6 /* cli.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = cli.swift; sourceTree = "<group>"; };
7491
A4317FDA26BA6EDE0012CCA6 /* walk.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = walk.swift; sourceTree = "<group>"; };
7592
A44447B326AC60C6004A4D4D /* file_operations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = file_operations.swift; sourceTree = "<group>"; };
93+
A46598B626BC48300032651E /* icloudstats */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = icloudstats; sourceTree = BUILT_PRODUCTS_DIR; };
94+
A46598B826BC48300032651E /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
95+
A46598BD26BC48470032651E /* cli.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = cli.swift; sourceTree = "<group>"; };
96+
A46598C226BC48960032651E /* walk.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = walk.swift; sourceTree = "<group>"; };
97+
A46598C426BC48D00032651E /* stats.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = stats.swift; sourceTree = "<group>"; };
7698
A4A9A89226AAF1F900706A28 /* icloudbackup */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = icloudbackup; sourceTree = BUILT_PRODUCTS_DIR; };
7799
A4A9A89526AAF1F900706A28 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
78100
A4BCBAA226AD5F3500CE89F6 /* walk_src.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = walk_src.swift; sourceTree = "<group>"; };
@@ -92,6 +114,14 @@
92114
);
93115
runOnlyForDeploymentPostprocessing = 0;
94116
};
117+
A46598B326BC48300032651E /* Frameworks */ = {
118+
isa = PBXFrameworksBuildPhase;
119+
buildActionMask = 2147483647;
120+
files = (
121+
A46598C726BC48DC0032651E /* ArgumentParser in Frameworks */,
122+
);
123+
runOnlyForDeploymentPostprocessing = 0;
124+
};
95125
A4A9A88F26AAF1F900706A28 /* Frameworks */ = {
96126
isa = PBXFrameworksBuildPhase;
97127
buildActionMask = 2147483647;
@@ -139,13 +169,25 @@
139169
path = shared;
140170
sourceTree = "<group>";
141171
};
172+
A46598B726BC48300032651E /* icloudstats */ = {
173+
isa = PBXGroup;
174+
children = (
175+
A46598B826BC48300032651E /* main.swift */,
176+
A46598BD26BC48470032651E /* cli.swift */,
177+
A46598C226BC48960032651E /* walk.swift */,
178+
A46598C426BC48D00032651E /* stats.swift */,
179+
);
180+
path = icloudstats;
181+
sourceTree = "<group>";
182+
};
142183
A4A9A88926AAF1F800706A28 = {
143184
isa = PBXGroup;
144185
children = (
145186
A4317FDF26BA71450012CCA6 /* shared */,
146187
A4A9A89426AAF1F900706A28 /* icloudbackup */,
147188
A4317FD126BA6CAB0012CCA6 /* iclouddownload */,
148189
A4D287C026BAE77A00EE9157 /* icloudoffload */,
190+
A46598B726BC48300032651E /* icloudstats */,
149191
A4A9A89326AAF1F900706A28 /* Products */,
150192
A4317FDC26BA6F6A0012CCA6 /* Frameworks */,
151193
);
@@ -157,6 +199,7 @@
157199
A4A9A89226AAF1F900706A28 /* icloudbackup */,
158200
A4317FD026BA6CAB0012CCA6 /* iclouddownload */,
159201
A4D287BF26BAE77A00EE9157 /* icloudoffload */,
202+
A46598B626BC48300032651E /* icloudstats */,
160203
);
161204
name = Products;
162205
sourceTree = "<group>";
@@ -206,6 +249,26 @@
206249
productReference = A4317FD026BA6CAB0012CCA6 /* iclouddownload */;
207250
productType = "com.apple.product-type.tool";
208251
};
252+
A46598B526BC48300032651E /* icloudstats */ = {
253+
isa = PBXNativeTarget;
254+
buildConfigurationList = A46598BC26BC48300032651E /* Build configuration list for PBXNativeTarget "icloudstats" */;
255+
buildPhases = (
256+
A46598B226BC48300032651E /* Sources */,
257+
A46598B326BC48300032651E /* Frameworks */,
258+
A46598B426BC48300032651E /* CopyFiles */,
259+
);
260+
buildRules = (
261+
);
262+
dependencies = (
263+
);
264+
name = icloudstats;
265+
packageProductDependencies = (
266+
A46598C626BC48DC0032651E /* ArgumentParser */,
267+
);
268+
productName = icloudstats;
269+
productReference = A46598B626BC48300032651E /* icloudstats */;
270+
productType = "com.apple.product-type.tool";
271+
};
209272
A4A9A89126AAF1F900706A28 /* icloudbackup */ = {
210273
isa = PBXNativeTarget;
211274
buildConfigurationList = A4A9A89926AAF1F900706A28 /* Build configuration list for PBXNativeTarget "icloudbackup" */;
@@ -259,6 +322,9 @@
259322
A4317FCF26BA6CAB0012CCA6 = {
260323
CreatedOnToolsVersion = 12.5.1;
261324
};
325+
A46598B526BC48300032651E = {
326+
CreatedOnToolsVersion = 12.5.1;
327+
};
262328
A4A9A89126AAF1F900706A28 = {
263329
CreatedOnToolsVersion = 12.5.1;
264330
};
@@ -287,6 +353,7 @@
287353
A4A9A89126AAF1F900706A28 /* icloudbackup */,
288354
A4317FCF26BA6CAB0012CCA6 /* iclouddownload */,
289355
A4D287BE26BAE77A00EE9157 /* icloudoffload */,
356+
A46598B526BC48300032651E /* icloudstats */,
290357
);
291358
};
292359
/* End PBXProject section */
@@ -305,6 +372,20 @@
305372
);
306373
runOnlyForDeploymentPostprocessing = 0;
307374
};
375+
A46598B226BC48300032651E /* Sources */ = {
376+
isa = PBXSourcesBuildPhase;
377+
buildActionMask = 2147483647;
378+
files = (
379+
A46598C326BC48960032651E /* walk.swift in Sources */,
380+
A46598C526BC48D00032651E /* stats.swift in Sources */,
381+
A46598BF26BC484D0032651E /* placeholder.swift in Sources */,
382+
A46598BE26BC48470032651E /* cli.swift in Sources */,
383+
A46598B926BC48300032651E /* main.swift in Sources */,
384+
A46598C026BC48500032651E /* extensions.swift in Sources */,
385+
A46598C126BC48520032651E /* file_operations.swift in Sources */,
386+
);
387+
runOnlyForDeploymentPostprocessing = 0;
388+
};
308389
A4A9A88E26AAF1F900706A28 /* Sources */ = {
309390
isa = PBXSourcesBuildPhase;
310391
buildActionMask = 2147483647;
@@ -358,6 +439,28 @@
358439
};
359440
name = Release;
360441
};
442+
A46598BA26BC48300032651E /* Debug */ = {
443+
isa = XCBuildConfiguration;
444+
buildSettings = {
445+
CODE_SIGN_STYLE = Automatic;
446+
DEVELOPMENT_TEAM = QEZ83PUW72;
447+
ENABLE_HARDENED_RUNTIME = YES;
448+
PRODUCT_NAME = "$(TARGET_NAME)";
449+
SWIFT_VERSION = 5.0;
450+
};
451+
name = Debug;
452+
};
453+
A46598BB26BC48300032651E /* Release */ = {
454+
isa = XCBuildConfiguration;
455+
buildSettings = {
456+
CODE_SIGN_STYLE = Automatic;
457+
DEVELOPMENT_TEAM = QEZ83PUW72;
458+
ENABLE_HARDENED_RUNTIME = YES;
459+
PRODUCT_NAME = "$(TARGET_NAME)";
460+
SWIFT_VERSION = 5.0;
461+
};
462+
name = Release;
463+
};
361464
A4A9A89726AAF1F900706A28 /* Debug */ = {
362465
isa = XCBuildConfiguration;
363466
buildSettings = {
@@ -479,7 +582,6 @@
479582
CODE_SIGN_STYLE = Automatic;
480583
DEVELOPMENT_TEAM = QEZ83PUW72;
481584
ENABLE_HARDENED_RUNTIME = YES;
482-
MACOSX_DEPLOYMENT_TARGET = 11.3;
483585
PRODUCT_BUNDLE_IDENTIFIER = "se.eberl.icloud-backup";
484586
PRODUCT_NAME = "$(TARGET_NAME)";
485587
SWIFT_VERSION = 5.0;
@@ -492,7 +594,6 @@
492594
CODE_SIGN_STYLE = Automatic;
493595
DEVELOPMENT_TEAM = QEZ83PUW72;
494596
ENABLE_HARDENED_RUNTIME = YES;
495-
MACOSX_DEPLOYMENT_TARGET = 11.3;
496597
PRODUCT_BUNDLE_IDENTIFIER = "se.eberl.icloud-backup";
497598
PRODUCT_NAME = "$(TARGET_NAME)";
498599
SWIFT_VERSION = 5.0;
@@ -533,6 +634,15 @@
533634
defaultConfigurationIsVisible = 0;
534635
defaultConfigurationName = Release;
535636
};
637+
A46598BC26BC48300032651E /* Build configuration list for PBXNativeTarget "icloudstats" */ = {
638+
isa = XCConfigurationList;
639+
buildConfigurations = (
640+
A46598BA26BC48300032651E /* Debug */,
641+
A46598BB26BC48300032651E /* Release */,
642+
);
643+
defaultConfigurationIsVisible = 0;
644+
defaultConfigurationName = Release;
645+
};
536646
A4A9A88D26AAF1F800706A28 /* Build configuration list for PBXProject "icloud-backup" */ = {
537647
isa = XCConfigurationList;
538648
buildConfigurations = (
@@ -592,6 +702,11 @@
592702
package = A408074B26AAF305009FD4F4 /* XCRemoteSwiftPackageReference "swift-argument-parser" */;
593703
productName = ArgumentParser;
594704
};
705+
A46598C626BC48DC0032651E /* ArgumentParser */ = {
706+
isa = XCSwiftPackageProductDependency;
707+
package = A408074B26AAF305009FD4F4 /* XCRemoteSwiftPackageReference "swift-argument-parser" */;
708+
productName = ArgumentParser;
709+
};
595710
A490AB7826B9AA2A007C1120 /* Chalk */ = {
596711
isa = XCSwiftPackageProductDependency;
597712
package = A490AB7726B9AA2A007C1120 /* XCRemoteSwiftPackageReference "Chalk" */;

0 commit comments

Comments
 (0)