Configuration:
WWWDIR – the location of the WWW folder
ROOTDIR – the primary folder of the backup solution where the backup files will be stored
BACKUPDIR – the actual location where WWW folder will be backed up
BACKUPPART – the filesystem partitition mount where backups are stored. This is used to determine if there is enough free space to create a new backup.
WEEKLY – the reference week day choosen for the backups to be kept (ex: Sun)
The script will create the necessary folders in order to store the backup files and the logs.
It will also check the disk partition where the backups are stored if it has enough free disk space to perform a new back up (previous backup + 5% of disk space coverage). If the estimated free space left (after the backup is performed) is below 10% , it will delete all previous backups .
If current is the same as WEEKLY variable value, all the previous 6 backup files will be deleted, of course after creating the new backup file.
Upload www-backup-template.sh file to your WWW server.
Change WWWDIR, ROOTDIR, BACKUPDIR, BACKUPPART and WEEKLY variables with the proper values according to your needs.
Create the cronjob for the WWW backup script :
00 04 * * * /bin/bash /path/to/www-backup.sh >/dev/null 2>&1
Configuration:
MAILDIR – the location of the mail folder (preferably for all accounts)
ROOTDIR – the primary folder of the backup solution where the backup files will be stored
BACKUPDIR – the actual location where e-mails will be backed up
BACKUPPART – the filesystem partitition mount where backups are stored. This is used to determine if there is enough free space to create a new backup.
WEEKLY – the reference week day choosen for the backups to be kept (ex: Sun)
The script will create the necessary folders in order to store the backup files and the logs.
It will also check the disk partition where the backups are stored if it has enough free disk space to perform a new backup (previous backup + 5% of disk space coverage ). If the estimated free space left (after the backup is performed) is below 10% , it will delete all previous backups .
If current is the same as WEEKLY variable value, all the previous 6 backup files will be deleted, of course after creating the new backup file.
Upload mail-backup-template.sh file to your mail server.
Change MAILDIR, ROOTDIR, BACKUPDIR, BACKUPPART and WEEKLY variables with the proper values according to your needs.
Create the cronjob for the mail backup script :
00 05 * * * /bin/bash /path/to/mail-backup.sh >/dev/null 2>&1
Configuration:
ROOTDIR – the primary folder of the backup solution where the backup files will be stored
BACKUPDIR – the actual location where databases will be backed up
BACKUPPART – the filesystem partitition mount where backups are stored. This is used to determine if there is enough free space to create a new backup.
WEEKLY – the reference week day choosen for the backups to be kept (ex: Sun)
DBuser – the MySQL user used to access the databases
DBpass – the MySQL password for the DBuser
DBhost – the MySQL server host or IP address
The script will create the necessary folders in order to store the databases backup and the logs. It will connect to the MySQL server with the given credentials and will backup all databases that the given MySQL user has access to.
It will also check the disk partition where the backups are stored if it has enough free disk space to perform a new backup ( previous backup + 5% of disk space coverage ) . If the estimated free space left (after the backup is performed) is below 10% , it will delete all previous backups .
If current is the same as WEEKLY variable value, all the previous 6 backup files will be deleted, of course after creating the new backup file.
Upload mysql-backup-template.sh file to your backup server.
Change ROOTDIR, BACKUPDIR, BACKUPPART, WEEKLY, DBuser, DBpass and DBhost variables with the proper values according to your needs.
Create the cronjob for the mail backup script :
00 06 * * * /bin/bash /path/to/mysql-backup.sh >/dev/null 2>&1
P.S. Don’t hesitate to contact me by e-mail if you encounter difficulties.