我正在使用偶发性将Linux服务器备份到Amazon S3。
我在这里找到了很多资源,可以帮助我进行设置,并且正在使用为我列出的基本脚本,现在将其复制到此处:
#!/bin/sh
# Export some ENV variables so you don't have to type anything
export AWS_ACCESS_KEY_ID=[your-access-key-id]
export AWS_SECRET_ACCESS_KEY=[your-secret-access-key]
export PASSPHRASE=[your-gpg-passphrase]
GPG_KEY=[your-gpg-key]
# The source of your backup
SOURCE=/
# The destination
# Note that the bucket need not exist
# but does need to be unique amongst all
# Amazon S3 users. So, choose wisely.
DEST=s3+http://[your-bucket-name]/[backup-folder]
duplicity \
--encrypt-key=${GPG_KEY} \
--sign-key=${GPG_KEY} \
--include=/boot \
--include=/etc \
--include=/home \
--include=/root \
--include=/var/lib/mysql \
--exclude=/** \
${SOURCE} ${DEST}
# Reset the ENV variables. Don't need them sitting around
export AWS_ACCESS_KEY_ID=
export AWS_SECRET_ACCESS_KEY=
export PASSPHRASE=
其他人是否有过重复工作的经验,可以改进此脚本和/或分享最佳实践以帮助创建更好的脚本?