User:Alvaro Ortiz-Troncoso/Moved backups to /mnt/backup
DONE
Backups can now be saved to a backup drive. The drive in mounted on /mnt/backup. Previously, backups were saved to /mnt/dump/var/backups. Note: /var/backups is a link to /mnt/dump/var/backups.
Backup of /etc/backupscripts/ in /etc/backupscripts.20150911
Set DBBAKDIR_ROOT="/mnt/backup" in these scripts in /etc/backupscripts:
- daily_bak_entry.sh
- daily_bak_master.sh
The following scripts are unchanged, as they take their paths from daily_bak_master.sh:
- daily_bak_mysql.sh
- daily_bak_svn.sh
- daily_bak_settings.sh
- daily_bak_wiki_media.sh
Copied everything from /mnt/dump/var/backups into /mnt/backup, keeping owners, permissions and timestamps
sudo cp -rp /mnt/dump/var/backups/DAILY /mnt/backup sudo cp -rp /mnt/dump/var/backups/WEEKLY /mnt/backup sudo cp -rp /mnt/dump/var/backups/MONTHLY /mnt/backup sudo cp -p /mnt/dump/var/backups/* /mnt/backup
/var/backups now points to /mnt/backup, as the scripts which create apt-, dpkg-, passwd-, group-, gshadow- and shadow-backups have hard coded the path to /var/backups.
Cron has to be restarted to reload files which are not in /etc/cron.d
sudo service cron restart
To Do
The old backup files can now be found in /var/backups_old. These files can be deleted if everything works fine (it does not).
Log
13.09.2015 backup moved to /mnt/backup
14.09.2015 REVERTED as /mnt/backup was re-mounted read-only due to errors
15.09.2015 Ran badblocks command. Did not find errors.
sudo badblocks -v /dev/xvdf > /home/alvaro/badblocks
16.09.2015 Remounted /mnt/backup. /var/backups now points to /mnt/backup
sudo umount /mnt/backup sudo mount -t ext4 -o remount,rw /dev/xvdf /mnt/backup
17.09.2015 REVERTED as /mnt/backup was re-mounted read-only due to errors