Difference between revisions of "Shells backup"

From Insomnia 24/7 Wiki
Jump to: navigation, search
imported>Wikiadmin
m
(File backups)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
We make full backups of all the home directories and databases to an off-site server every Monday, Wednesday and Friday at 5:40am local time.
 
 
 
 
=== File backups ===
 
=== File backups ===
  
To restore a file from this backup to your account you can use the '''backup''' command.
+
A nightly backup of the main storage (SSD array) is made every day at 11pm local time. For the coldstorage drive there is a weekly backup made every Sunday. These backups are mainly meant to have a restore point in case some form of catastrophic failure should occur, however if you need files from the backup you can contact a member of our staff to help restore it for you. (In the future we will be adding an automated system for this, but for now contacting staff is the only way.)
You can also use the same command to back up a file at any time.
 
 
 
Usage:
 
:backup -r /home/username/file.txt restores file.txt to the version found in the backup. (option -r is the same as --restore)
 
:backup -b /home/username/file.txt saves file.txt to the backup server. (option -b is the same as --backup)
 
 
 
 
 
If you want to check the last date and time a backup was made, you can check at [http://backup.insomnia247.nl the backup webinterface].
 
 
 
 
 
Known bugs:
 
:Filenames with spaces aren't handled properly yet. They are backed up in the periodical backups, but they can't be restored automatically. If you need such a file restored please ask one of our staff members to restore it manually.
 
 
 
  
 
=== MySQL database backups ===
 
=== MySQL database backups ===
  
Though we do include the MySQL databases in our backups, you can not restore them manually (due to file permissions etc.)
+
We do include a backup of the full MySQL server in our backups, but it is usually not practical to try and restore a single database from the master backup. Therefore if you require backups of your MySQL database(s) we recommend you create a cronjob to dump your database on a regular basis.
Should you need this feature, or do you want to keep extra backups of your databases for whichever other reason, you can create a cronjob to do so.
 
  
 
  user@Lydia:~$ crontab -e
 
  user@Lydia:~$ crontab -e
Line 28: Line 11:
 
This will open up your crontab for editing. Add the following command to make a daily backup of your database.
 
This will open up your crontab for editing. Add the following command to make a daily backup of your database.
  
  @daily mysqldump -u username -pmysqlpassword databasename > backupfile.sql
+
  @daily mysqldump -u databse_username -pdatabase_password database_name > $HOME/mysql_backups/my_database.sql
  
 
Obviously you need to replace the username, password, database and backupfile.sql with the ones you use.
 
Obviously you need to replace the username, password, database and backupfile.sql with the ones you use.
 
Make sure to include the full path in the backup file name. (/home/username/mybackup/database.sql).
 
Make sure to include the full path in the backup file name. (/home/username/mybackup/database.sql).
 
:There is '''no space''' between -p and your password!
 
:There is '''no space''' between -p and your password!
 
 
You can also add the backup command trough your [https://www.insomnia247.nl:20000 usermin] under Others -> Scheduled Cron Jobs -> Create a new scheduled cron job.
 
 
You do not need to add the @daily to the command if you do it through usermin. The timing of when the backups are made can be specified on the Cron Job creation page.
 

Latest revision as of 00:29, 14 February 2020

File backups

A nightly backup of the main storage (SSD array) is made every day at 11pm local time. For the coldstorage drive there is a weekly backup made every Sunday. These backups are mainly meant to have a restore point in case some form of catastrophic failure should occur, however if you need files from the backup you can contact a member of our staff to help restore it for you. (In the future we will be adding an automated system for this, but for now contacting staff is the only way.)

MySQL database backups

We do include a backup of the full MySQL server in our backups, but it is usually not practical to try and restore a single database from the master backup. Therefore if you require backups of your MySQL database(s) we recommend you create a cronjob to dump your database on a regular basis.

user@Lydia:~$ crontab -e

This will open up your crontab for editing. Add the following command to make a daily backup of your database.

@daily mysqldump -u databse_username -pdatabase_password database_name > $HOME/mysql_backups/my_database.sql

Obviously you need to replace the username, password, database and backupfile.sql with the ones you use. Make sure to include the full path in the backup file name. (/home/username/mybackup/database.sql).

There is no space between -p and your password!