Skip to content

Instantly share code, notes, and snippets.

@adinata-id
Forked from iamkingsleyf/backuptos3.sh
Created November 3, 2023 15:39
Show Gist options
  • Save adinata-id/d90a664c0d30026fe0dc9b1ab08833fb to your computer and use it in GitHub Desktop.
Save adinata-id/d90a664c0d30026fe0dc9b1ab08833fb to your computer and use it in GitHub Desktop.
#!/bin/sh
echo 'Started'
date +'%a %b %e %H:%M:$S %Z %Y'
s3cmd sync --recursive --preserve /srv s3://nameofyours3bucket
s3cmd sync --recursive --preserve /etc s3://nameofyours3bucket
s3cmd sync --recursive --preserve /home s3://nameofyours3bucket
s3cmd sync --recursive --preserve /var s3://nameofyours3bucket
dpkg --get-selections > dpkg.list
s3cmd sync --recursive --preserve dpkg.list s3://nameofyours3bucket
date +'%a %b %e %H:%M:$S %Z %Y'
echo 'Finished'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment