=== Lamp Backup Utility ===
0.3
- Weekly Backups.
0.2
- It nows backup the entire www folder by default, it can be changed at begining of the file
0.1
- It backups testing folders, live folders and /etc
- Exports all MySQL databases into one the backups folder.
=== Installation ===
- Create a folder to store your backups.
- Open backups.sh using any editor (like vim).
- Change the value of OUTPUTDIR to reflect the folder you just created.
- Modify the value of DIRTOBACKUP to reflect the folder you want to backup
- Close the file
- Open my.cnf using any editor.
- Input your MySQL user and password.
- For security reasons you can create a specific user with only reading permissions.
- Close the file
- Run ./backups.sh
=== Crontab ===
I include a crontab example to set up this backup to run every day at 00:05 and report to that email address
# m h dom mon dow command
MAILTO="youremailaddress@server.com"
5 0 * * * /root/bash_backup/backups.sh
A weekly setup example will run the script every night at 23:40 hrs.
MAILTO="youremailaddress@server.com"
40 23 * * * /home/<username>/backup_ftp_week.sh
=== TODO ===
- Add an option to rsync the folder after doing the backup
=== Credits ===
Ivan Soto http://ivansotof.com
Karim Jetha
-
Create backup user in Dreamhost control panel
-
Select db user and add server IP wildcard to required list
-
Change the FTP user to Shell in the control panel.
-
Upload backup_ftp_week.sh, chmod to 775 and change variables in script
-
Create folder called serverbackups under the user's main folder.
-
Test (bash backup_ftp_week.sh)
-
Set up cron
MAILTO="youremailaddress@server.com" 40 23 * * * /home//backup_ftp_week.sh