Performing data backups¶
No backup is performed automatically. It must be defined explicitly by the user using satan backup command. Please remember about hard drive space limits. Backup should not extend over 10GB. Plan your backup policy having space restrictions in mind.
Syntax¶
The syntax is as follows:
satan backup add <name>
satan backup add <name> <type>
satan backup add <name> <type> <schedule>
satan backup del <name>
satan backup del <id>
satan backup include <name> <file or directory>
satan backup exclude <name> <file or directory>
satan backup list
satan backup list <name>
Syntax can be displayed anytime by typing satan backup help.
| Command | Description |
|---|---|
| satan backup add <name> | Create a new backup with default type home and schedule full. |
| satan backup add <name> <type> | Create a new backup with specified type. Available types are: home and www. The home type is to backup data from shell servers, whereas the www type is to backup data from web server. |
| satan backup add <name> <type> <schedule> | Create a new backup with specified type and schedule. For now there is only one schedule type: full, which makes daily backup kept for 7 days and weekly backup kept for 3 weeks. |
| satan backup del <name> | Select backup to be removed. Because of security reasons files from backup cannot be deleted by user. |
| satan backup del <id> | Remove a file or directory from include. |
| satan backup include <name> <file or directory> | Add a file or a directory to specified backup. You must specify full path e.g. /home/login/directory. Directory or file must not be a symlink. For type home path must start with /home/login and for type www with /home2/login. |
| satan backup list | Show listing and status of all backups. |
| satan backup list <name> | List files included and excluded from backup. Include records are starting with + sign, exclude records with - sign. |
- Defaults:
- type: home
- schedule: full
Backup types¶
At the moment there are only two backup types:
- home
- With this type you can backup data from the shell server. The path of included/excluded files should begin with /home/login.
- www
- This type is used to backup data from web server. The path of included/excluded files should begin with /home2/login.
- local
- This type is used to make backup of your local computer. It doesn’t need to be configured on satan side. See below.
Warning
New web servers were introduced recently (Fastweb). At the moment you cannot backup data from those servers by yourself. Backup of all fastweb data is done automatically.
Local computer¶
To backup your computer use FTP client. To connect please use secure protocol FTPES. The host is backup1.rootnode.net. The login and the password is the same as to shell server. Do not upload any warez, pornography and illegal content.
Schedules¶
There is only one schedule available: full. It keeps everyday backup for 7 days and every week backup for 3 weeks. Every backup is a snapshot which means you do not need any special tools to restore data from backup. The data is as-is saved in certain time. Backup is located in ~/backup directory and they can be freely viewed. Backup directory is read-only though.
The structure of backup directory is as follows:
|-- sites
| |-- daily.0
| |-- daily.1
| |-- daily.2
| |-- daily.3
| |-- daily.4
| |-- daily.5
| |-- daily.6
| |-- weekly.0
| |-- weekly.1
| `-- weekly.2
|
|-- local
Where daily.0 is the newest backup, daily.1 is yesterday’s backup and so on. In directory weekly.0 you will find last week’s backup. The local computer backups goes to local.
Include/Exclude list¶
To every backup you must define include/exclude list which points files and directories included or excluded from backup. The simplest way is to add a directory you want to backup e.g. /home/login/directory. Please remember about drive space. It is better to exclude few directories than to backup unimportant data. You can select your data in two ways:
- Include home directory and exclude files and sub-directories we do not want.
- Only include directories we want to backup.
To include something use satan backup include command. To exclude use satan backup exclude. To delete entry from include/exclude list use satan backup del <id> command, where <id> is ID number of the entry you want to drop.
Please remember that include and exclude commands work on the same level. include is not an opposite to exclude. Also exclude command doesn’t delete previously included entry.
Status messages¶
List of all available status messages:
| Status | Description |
|---|---|
| scheduled | Backup was scheduled. |
| running | Backup is running at the moment. |
| done | Backup was successfully finished. |
| failed | Backup failed because of unknown reason. |
| nokey | There is no public key in ~/.ssh/authorized_keys and backup cannot be run. Key is added automatically after satan backup add command. Make sure to check permissions to .ssh directory and authorized_key file. |
| nouser | User doesn’t exist on backup server. Please contact with administrator. |
| n/a | Status not available. Can be seen only after adding new backup. |
Restore from backup¶
It is very easy to restore files from backup because you only need to copy files from appropriate directory inside ~/backup. In daily.0 you will find the latest backup. You do not need any special tool to restore files. Just use cp -r command.
Examples¶
Creating backup¶
As an example we will create two backups: first for home directory and second for web sites:
$ satan backup add homebackup home
$ satan backup add sites www
$ satan backup include homebackup /home/login
$ satan backup include sites /home2/login/www
Listing backups¶
To list all backups we will use satan backup list command:
$ satan backup list
Backups
Name Type Size Last backup Status Next backup Status
sites www - never n/a 2009-10-31 19:39:48 scheduled
homebackup home - never
From above status you can see that backups were added correctly and they were scheduled. By default backup is scheduled 15 minutes up front from the time of adding backup. After 15 minutes backup should run and you would see:
$ satan backup list
Backups
Name Type Size Last backup Status Next backup Status
sites www 315M 2009-10-31 19:46:19 done 2009-11-01 19:39:48 scheduled
homebackup home 56M 2009-10-31 19:42:52 done 2009-11-01 19:39:44 scheduled
As you can see status of the last backup is done. That means the backup was successful. Next backup was scheduled to next day. In the listing you can also see size of the backup.
Include/Exclude list¶
To display include/exclude list from particular backup use following command:
$ satan backup list sites
Backup => sites
Id Name Type
249 + /home2/login/www dir
where sites is the name of the backup. As you can see we succeeded adding backup. Sign + in the front means this is include entry. Every included or excluded file/directory has its ID. If you want to delete an entry run:
$ satan backup del 249
where 249 is ID of the entry.