Last active
November 28, 2018 08:09
-
-
Save yogoeasy/7506344ec5369fb53c458c62fdeb02d2 to your computer and use it in GitHub Desktop.
runcloud-remote-backup
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| webroot=/home/runcloud/webapps | |
| cd $webroot | |
| for d in *; | |
| do | |
| domaindir=$(basename $d) | |
| [[ $domaindir =~ ^(22222|html|www)$ ]] && continue #自行修改要排除備份上傳的webapps | |
| echo "*******************************" | |
| echo "Transfer files for '$domaindir'" | |
| echo "*******************************" | |
| ls $webroot/"$domaindir"/wp-content && cd $webroot/"$domaindir"/wp-content && wp db export backup.sql --allow-root && rsync -avz --exclude 'updraft' --exclude 'cache' --delete --bwlimit=627 $webroot/"$domaindir" backup:000 && rm $webroot/"$domaindir"/wp-content/*.sql | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment