Copyspace is a powerful and efficient CLI tool for concurrently copying files and directories to DigitalOcean Spaces and AWS S3-compatible buckets. Written in Go, it uses goroutines to maximize transfer speeds and supports multiple concurrent workers. Ideal for backups, migrations, and synchronization in multi-cloud environments.
• Concurrent upload and download of files and directories • Full support for DigitalOcean Spaces and AWS S3 • Dynamic configuration of bucket, endpoint and permissions (ACL) • Automatic detection of the file MIME type • Advanced error management and colored logs for better visualization • Control of the number of workers for performance optimization • Recursive download maintaining the structure of local directories • Use of contexts for cancellation and synchronization of processes
You can install Copyspace easily on any Linux or Mac system by running:
sh -c "$(wget https://raw.githubusercontent.com/jeffotoni/copyspace/refs/heads/master/v1/install.sh -O -)"echo $PATHIf /usr/local/bin is missing, add it to your shell configuration file:
- For Zsh users, add this line to your ~/.zshrc:
export PATH="/usr/local/bin:$PATH"For Bash users, add this line to your ~/.bashrc:
export PATH="/usr/local/bin:$PATH"Then reload your shell (replace with your shell as appropriate):
source ~/.zshrc
# or
source ~/.bashrcwhich copyspaceIt should print something like:
/usr/local/bin/copyspaceCheck which copyspace binary is found first in your PATH:
Now, you can run:
copyspace -hIf you still have issues, check for duplicate or conflicting binaries in other directories (e.g., /usr/bin). Adjust your PATH order if needed to prioritize /usr/local/bin.
You will need to create a hidden file in your home, .dokeys which needs to contain your credentials.
- Set up the credentials file (.dokeys) in your home directory.
- Run the desired command as per the examples above.
- Monitor the colored log to track progress and errors
{
"key":"xxxxxxxxxxxx",
"secret":"xxxxxxxxxx",
"endpoint":"https://sfo2.digitaloceanspaces.com",
"region":"us-east-1",
"bucket":"your-bucket"
}You can easily build platform-specific binaries using the provided Makefile:
# Build all binaries (Mac ARM, Mac Intel, Linux AMD64, Linux 386)
make
# Build only for your current platform (e.g., Mac ARM64)
make mac-arm64
# Clean up all generated binaries
make cleanBinaries generated:
• copyspace-mac-arm64
• copyspace-mac-amd64
• copyspace-linux-amd64
• copyspace-linux-386
• copyspace-windows-amd64.exe
• copyspace-windows-386.exe
Upload a single file to the bucket
copyspace -file /path/to/file.txt -bucket bucket-nameUpload an entire directory recursively with 100 concurrent workers
copyspace -file /path/to/directory -bucket bucket-name -worker 100Set public permission for the uploaded files
copyspace -file /path/to/file.txt -bucket bucket-name -acl publicEnable recursive download mode from a bucket to a local directory
copyspace -cp -bucket bucket-name -out /path/to/destinationShow help with all available options
copyspace -h