Difference between revisions of "User:Alvaro Ortiz-Troncoso/Moved backups to /mnt/backup"

From Biowikifarm Metawiki
Jump to: navigation, search
(CURRENTLY TESTING)
Line 1: Line 1:
 +
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
 +
 +
''alternative: copy just the directory structure''
 +
 +
sudo find -type d -links 2 -exec mkdir -p "/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
 +
 +
 
=History=
 
=History=
 
;13.09.2015
 
;13.09.2015
Line 32: Line 65:
 
;21.12.2015
 
;21.12.2015
 
:NEW TEST. Since the network was reconfigured by WF. Seems to work.
 
:NEW TEST. Since the network was reconfigured by WF. Seems to work.
 
==CURRENTLY TESTING==
 
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
 
 
''alternative: copy just the directory structure''
 
 
sudo find -type d -links 2 -exec mkdir -p "/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
 

Revision as of 10:22, 6 January 2016

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

alternative: copy just the directory structure

sudo find -type d -links 2 -exec mkdir -p "/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


History

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
01.10.2015
After checking with the system administrator of MfN, remounted /mnt/backup. /var/backups now points to /mnt/backup
09.10.2015
REVERTED. All changes have been reverted, as there are problems with the integration of the backup partition and Xen. As I have no access to the virtual machine's hypervisor and the system administrator of MfN could not solve the problem, I have reverted all the changes to the previous situation. So backups are being made, but they are on the same machine as the operating system.
16.10.2015
NEW TEST. I will try to run the backups to the new partition during the weekend. The partition is now correctly mounted as read-write. If the backups fail again, I will definitely stop trying.
19.10.2015
Test failed. Reverted.
21.12.2015
NEW TEST. Since the network was reconfigured by WF. Seems to work.