Skip to content

BASH script to sync local files to external USB-key AND off-site backup on cloud using s3cmd cli as AWS storage-compatible DO Spaces

License

Notifications You must be signed in to change notification settings

j-isreal/bash-sync-local-usb-cloud

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 

Repository files navigation

bash-sync-local-usb-cloud

BASH script to sync local files to external USB-key AND off-site backup on cloud using s3cmd cli as AWS storage-compatible DO Spaces

1. Setup s3cmd and cloud storage space

FIRST, either comment out the s3cmd lines, or setup s3cmd.

s3cmd is available from the linux repositories. You can use any AWS (Amazon)-compatible cloud storage service.

I prefer DigitalOcean Spaces - it's only $5.00 a month for 250GB of storage.

Here's a $250 credit with them:

DigitalOcean Referral Badge

1a. Ensure your s3cfg is configured and you can access the cloud storage

You will need your API key and secret to configure s3cmd.

Visit DigitalOcean for complete instructions.

Use the following to setup s3cmd:

s3cmd --configure

See following links for details:

2. Update variables in script and exclude file

NEXT, update all the variables at the top of the script - it will not work if you do not update the values.

To exclude files or folders from the sync, update the sync-local-exclude.txt file.

  • Enter each excluded file or folder on a separate line.
  • This backup script uses rsync to sync everything from the user's home folder root - you must exclude what you don't want backed up (like your Downloads folder).

3. Make script executable and run

Make the file executable by:

chmod +x sync-local.sh

Then run with:

./sync-local.sh

Remember to rotate log files, as they append to the logfile.

View on website

View on my website www.jinet.us

Copyright © 2024 Jacob Eiler, Isreal Consulting, LLC. All rights reserved.

About

BASH script to sync local files to external USB-key AND off-site backup on cloud using s3cmd cli as AWS storage-compatible DO Spaces

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages