Skip to navigation
Daily do a simple weekly rotation mysql/directory backup with ftp upload?
07.12.13
Reply
Anonymous
building a simple shell script what create backups from all mysql databases and a backup form a directory. it will rename those backup files with the number or weekday like db_1.tar.gz = db_monday etc. lftp will than upload and sync those files what result in a backup of the last 7 days (weekly rotation). 1. create folder and file allBackup/allBackup.sh 2. create sufolder allBackup/backups 3. edit allBackup/allBackup.sh #!/bin/bash time=`date +%u` mysqldump -u USERNAME -pPASSWORD --all-databases > "backups/db_${time}.sql" gzip -f "backups/db_${time}.sql" tar -cf backups/webs_${time}.tar /path_to_dir/myfolder/ lftp -uUSERNAME,PASSWORD -e "mirror -R --verbose backups / ;quit" FTPDOMAIN.COM
07.12.13
Reply
Anonymous
Information Epoch 1732473224
Worse is better.
Home
Notebook
Contact us