我有一个包含3个网站的服务器,我有以下bash脚本,它每天都会运行s3cmd sync命令:
#!/bin/sh
echo 'Started'
date +'%a %b %e %H:%M:%S %Z %Y'
s3cmd sync --recursive --preserve /etc/apache2 s3://mybucket
s3cmd sync --recursive --preserve /var/www/website1.com/public_html s3://mybucket
s3cmd sync --recursive --preserve /var/www/website2.com/public_html s3://mybucket
s3cmd sync --recursive --preserve /var/www/website3.com/public_html s3://mybucket
s3cmd sync --recursive --preserve /var/db_backups s3://mybucket
dpkg --get-selections > dpkg.list
s3cmd sync --recursive --preserve dpkg.list s3://mybucket
date +'%a %b %e %H:%M:%S %Z %Y'
echo 'Finished'但问题是,s3cmd sync命令会创建public_html文件夹,并将所有3个网站放入该文件夹中。
我想要做的是将这三个站点备份到单独的文件夹中。我如何使用上述命令来实现这一点?
https://stackoverflow.com/questions/38325719
复制相似问题