Skip to content

Commit

Permalink
Move swift-icloud-stats tool over to this repo
Browse files Browse the repository at this point in the history
  • Loading branch information
geberl committed Aug 5, 2021
1 parent 2379ca5 commit 8855d13
Show file tree
Hide file tree
Showing 9 changed files with 577 additions and 7 deletions.
34 changes: 29 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

### icloudbackup

*Copy files from iCloud Documents dir to another destination.*
*Copy files from your iCloud Documents directory to another destination.*

```shell
# Show help
Expand All @@ -33,9 +33,27 @@
./icloudbackup --src "/Users/guenther/Downloads/" --dst "/Volumes/Black/icloud-documents-backup/"
```

### icloudstats

*Show stats about your iCloud Documents directory*

```shell
# Show help
./icloudstats --help

# Show auto-detected documents directory
./icloudstats --show-src

# Scan and show stats
./icloudstats

# Scan and show stats of another directory
./icloudstats --src "/Users/guenther/Downloads/"
```

### iclouddownload

*Recursively download a directory below the iCloud Documents dir.*
*Recursively download a directory below the iCloud Documents directory.*

```shell
# Show help
Expand All @@ -50,7 +68,7 @@

### icloudoffload

*Recursively remove the local copies of a directory below the iCloud Documents dir.*
*Recursively remove the local copies of a directory below the iCloud Documents directory.*

```shell
# Show help
Expand All @@ -73,6 +91,10 @@ TODO: These are old.

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

![screenshot4](/screenshots/4.png?raw=true "Screenshot 4")

![screenshot5](/screenshots/5.png?raw=true "Screenshot 5")

## Dependencies

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

- Offloaded files only exist as a placeholder `*.plist` files on your drive
- These files only have a few bytes
- 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
- You need to analyze the content of the `*.plist` placeholder file along with real files
- Because of this common backup tools like `rsync` are of no use, would just copy the placeholder
- You need to download, backup and offload the real file
- This tool does exactly that
- You need to download, backup and offload the real file
- These tools help with those issues

## Know Issues

Expand Down
119 changes: 117 additions & 2 deletions icloud-backup/icloud-backup.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,14 @@
A4317FE126BA71610012CCA6 /* extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A408075026AAF3BE009FD4F4 /* extensions.swift */; };
A4317FE226BA718E0012CCA6 /* file_operations.swift in Sources */ = {isa = PBXBuildFile; fileRef = A44447B326AC60C6004A4D4D /* file_operations.swift */; };
A44447B426AC60C6004A4D4D /* file_operations.swift in Sources */ = {isa = PBXBuildFile; fileRef = A44447B326AC60C6004A4D4D /* file_operations.swift */; };
A46598B926BC48300032651E /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = A46598B826BC48300032651E /* main.swift */; };
A46598BE26BC48470032651E /* cli.swift in Sources */ = {isa = PBXBuildFile; fileRef = A46598BD26BC48470032651E /* cli.swift */; };
A46598BF26BC484D0032651E /* placeholder.swift in Sources */ = {isa = PBXBuildFile; fileRef = A408075426AAF3FD009FD4F4 /* placeholder.swift */; };
A46598C026BC48500032651E /* extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = A408075026AAF3BE009FD4F4 /* extensions.swift */; };
A46598C126BC48520032651E /* file_operations.swift in Sources */ = {isa = PBXBuildFile; fileRef = A44447B326AC60C6004A4D4D /* file_operations.swift */; };
A46598C326BC48960032651E /* walk.swift in Sources */ = {isa = PBXBuildFile; fileRef = A46598C226BC48960032651E /* walk.swift */; };
A46598C526BC48D00032651E /* stats.swift in Sources */ = {isa = PBXBuildFile; fileRef = A46598C426BC48D00032651E /* stats.swift */; };
A46598C726BC48DC0032651E /* ArgumentParser in Frameworks */ = {isa = PBXBuildFile; productRef = A46598C626BC48DC0032651E /* ArgumentParser */; };
A490AB7926B9AA2A007C1120 /* Chalk in Frameworks */ = {isa = PBXBuildFile; productRef = A490AB7826B9AA2A007C1120 /* Chalk */; };
A4A9A89626AAF1F900706A28 /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4A9A89526AAF1F900706A28 /* main.swift */; };
A4BCBAA326AD5F3500CE89F6 /* walk_src.swift in Sources */ = {isa = PBXBuildFile; fileRef = A4BCBAA226AD5F3500CE89F6 /* walk_src.swift */; };
Expand All @@ -43,6 +51,15 @@
);
runOnlyForDeploymentPostprocessing = 1;
};
A46598B426BC48300032651E /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
dstPath = /usr/share/man/man1/;
dstSubfolderSpec = 0;
files = (
);
runOnlyForDeploymentPostprocessing = 1;
};
A4A9A89026AAF1F900706A28 /* CopyFiles */ = {
isa = PBXCopyFilesBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -73,6 +90,11 @@
A4317FD826BA6D4A0012CCA6 /* cli.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = cli.swift; sourceTree = "<group>"; };
A4317FDA26BA6EDE0012CCA6 /* walk.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = walk.swift; sourceTree = "<group>"; };
A44447B326AC60C6004A4D4D /* file_operations.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = file_operations.swift; sourceTree = "<group>"; };
A46598B626BC48300032651E /* icloudstats */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = icloudstats; sourceTree = BUILT_PRODUCTS_DIR; };
A46598B826BC48300032651E /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
A46598BD26BC48470032651E /* cli.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = cli.swift; sourceTree = "<group>"; };
A46598C226BC48960032651E /* walk.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = walk.swift; sourceTree = "<group>"; };
A46598C426BC48D00032651E /* stats.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = stats.swift; sourceTree = "<group>"; };
A4A9A89226AAF1F900706A28 /* icloudbackup */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = icloudbackup; sourceTree = BUILT_PRODUCTS_DIR; };
A4A9A89526AAF1F900706A28 /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
A4BCBAA226AD5F3500CE89F6 /* walk_src.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = walk_src.swift; sourceTree = "<group>"; };
Expand All @@ -92,6 +114,14 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
A46598B326BC48300032651E /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
A46598C726BC48DC0032651E /* ArgumentParser in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
A4A9A88F26AAF1F900706A28 /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -139,13 +169,25 @@
path = shared;
sourceTree = "<group>";
};
A46598B726BC48300032651E /* icloudstats */ = {
isa = PBXGroup;
children = (
A46598B826BC48300032651E /* main.swift */,
A46598BD26BC48470032651E /* cli.swift */,
A46598C226BC48960032651E /* walk.swift */,
A46598C426BC48D00032651E /* stats.swift */,
);
path = icloudstats;
sourceTree = "<group>";
};
A4A9A88926AAF1F800706A28 = {
isa = PBXGroup;
children = (
A4317FDF26BA71450012CCA6 /* shared */,
A4A9A89426AAF1F900706A28 /* icloudbackup */,
A4317FD126BA6CAB0012CCA6 /* iclouddownload */,
A4D287C026BAE77A00EE9157 /* icloudoffload */,
A46598B726BC48300032651E /* icloudstats */,
A4A9A89326AAF1F900706A28 /* Products */,
A4317FDC26BA6F6A0012CCA6 /* Frameworks */,
);
Expand All @@ -157,6 +199,7 @@
A4A9A89226AAF1F900706A28 /* icloudbackup */,
A4317FD026BA6CAB0012CCA6 /* iclouddownload */,
A4D287BF26BAE77A00EE9157 /* icloudoffload */,
A46598B626BC48300032651E /* icloudstats */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -206,6 +249,26 @@
productReference = A4317FD026BA6CAB0012CCA6 /* iclouddownload */;
productType = "com.apple.product-type.tool";
};
A46598B526BC48300032651E /* icloudstats */ = {
isa = PBXNativeTarget;
buildConfigurationList = A46598BC26BC48300032651E /* Build configuration list for PBXNativeTarget "icloudstats" */;
buildPhases = (
A46598B226BC48300032651E /* Sources */,
A46598B326BC48300032651E /* Frameworks */,
A46598B426BC48300032651E /* CopyFiles */,
);
buildRules = (
);
dependencies = (
);
name = icloudstats;
packageProductDependencies = (
A46598C626BC48DC0032651E /* ArgumentParser */,
);
productName = icloudstats;
productReference = A46598B626BC48300032651E /* icloudstats */;
productType = "com.apple.product-type.tool";
};
A4A9A89126AAF1F900706A28 /* icloudbackup */ = {
isa = PBXNativeTarget;
buildConfigurationList = A4A9A89926AAF1F900706A28 /* Build configuration list for PBXNativeTarget "icloudbackup" */;
Expand Down Expand Up @@ -259,6 +322,9 @@
A4317FCF26BA6CAB0012CCA6 = {
CreatedOnToolsVersion = 12.5.1;
};
A46598B526BC48300032651E = {
CreatedOnToolsVersion = 12.5.1;
};
A4A9A89126AAF1F900706A28 = {
CreatedOnToolsVersion = 12.5.1;
};
Expand Down Expand Up @@ -287,6 +353,7 @@
A4A9A89126AAF1F900706A28 /* icloudbackup */,
A4317FCF26BA6CAB0012CCA6 /* iclouddownload */,
A4D287BE26BAE77A00EE9157 /* icloudoffload */,
A46598B526BC48300032651E /* icloudstats */,
);
};
/* End PBXProject section */
Expand All @@ -305,6 +372,20 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
A46598B226BC48300032651E /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
A46598C326BC48960032651E /* walk.swift in Sources */,
A46598C526BC48D00032651E /* stats.swift in Sources */,
A46598BF26BC484D0032651E /* placeholder.swift in Sources */,
A46598BE26BC48470032651E /* cli.swift in Sources */,
A46598B926BC48300032651E /* main.swift in Sources */,
A46598C026BC48500032651E /* extensions.swift in Sources */,
A46598C126BC48520032651E /* file_operations.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
A4A9A88E26AAF1F900706A28 /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
Expand Down Expand Up @@ -358,6 +439,28 @@
};
name = Release;
};
A46598BA26BC48300032651E /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = QEZ83PUW72;
ENABLE_HARDENED_RUNTIME = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
};
name = Debug;
};
A46598BB26BC48300032651E /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = QEZ83PUW72;
ENABLE_HARDENED_RUNTIME = YES;
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
};
name = Release;
};
A4A9A89726AAF1F900706A28 /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
Expand Down Expand Up @@ -479,7 +582,6 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = QEZ83PUW72;
ENABLE_HARDENED_RUNTIME = YES;
MACOSX_DEPLOYMENT_TARGET = 11.3;
PRODUCT_BUNDLE_IDENTIFIER = "se.eberl.icloud-backup";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand All @@ -492,7 +594,6 @@
CODE_SIGN_STYLE = Automatic;
DEVELOPMENT_TEAM = QEZ83PUW72;
ENABLE_HARDENED_RUNTIME = YES;
MACOSX_DEPLOYMENT_TARGET = 11.3;
PRODUCT_BUNDLE_IDENTIFIER = "se.eberl.icloud-backup";
PRODUCT_NAME = "$(TARGET_NAME)";
SWIFT_VERSION = 5.0;
Expand Down Expand Up @@ -533,6 +634,15 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
A46598BC26BC48300032651E /* Build configuration list for PBXNativeTarget "icloudstats" */ = {
isa = XCConfigurationList;
buildConfigurations = (
A46598BA26BC48300032651E /* Debug */,
A46598BB26BC48300032651E /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
A4A9A88D26AAF1F800706A28 /* Build configuration list for PBXProject "icloud-backup" */ = {
isa = XCConfigurationList;
buildConfigurations = (
Expand Down Expand Up @@ -592,6 +702,11 @@
package = A408074B26AAF305009FD4F4 /* XCRemoteSwiftPackageReference "swift-argument-parser" */;
productName = ArgumentParser;
};
A46598C626BC48DC0032651E /* ArgumentParser */ = {
isa = XCSwiftPackageProductDependency;
package = A408074B26AAF305009FD4F4 /* XCRemoteSwiftPackageReference "swift-argument-parser" */;
productName = ArgumentParser;
};
A490AB7826B9AA2A007C1120 /* Chalk */ = {
isa = XCSwiftPackageProductDependency;
package = A490AB7726B9AA2A007C1120 /* XCRemoteSwiftPackageReference "Chalk" */;
Expand Down
Loading

0 comments on commit 8855d13

Please sign in to comment.