Skip to content

Tag: aws

Simple backup using S3 Sync

Given that you have the AWS CLI installed and configured, here are a few examples of syncing directories with S3.

Sync your home directory:
aws s3 sync $HOME s3://homeof$USER

E.g. $USER is sil and $HOME is /home/sil, then this will copy all files from /home/sil to bucket homeofsil.

To download the files back to another directory:
mkdir $HOME/oldhome
aws s3 sync s3://homeof$USER $HOME/oldhome

More details about S3 Sync in the official documentation.