Backup Files Quickly and Easily
This documentations shows how to backup files, in our case the home directory, to a mounted drive. We will cover this topic with the applications Back in Time, that can be used graphically and on the command line and later rsync, a command line tool.
Back in Time and rsync are pre-installed on Trisquel GNU/Linux. For instructions on how to install them, see the Documentation about Installing, Updating and Removing Software.
Using Back in Time
How to initiate a back up of /home on an external drive
- In the Main Menu go to Other→Back in Time
- A prompt should pop up asking you if you want to restore, click No
A window titled Settings should pop up
- Here, select the drive where you want to back up, click on the folder icon in Where to save snapshots and select Computer > / > media > user > <name of the drive> (make sure the drive is mounted)
- To select /home/<user name> folder to backup, in Settings go to the tab titled Include, click Add folder and select the folder <user name>
Now, /home/<user name> should be listed in Include files and folders
- Click OK
A window titled Back in Time should pop up
- Click the Take a snapshot button to take the first snapshot.
After the snapshot is taken, it will be listed in the left bar. That's all! Your snapshot is done!
How to restore from backup
- In the Main Menu go to Other→Back in Time (root)
- A prompt should pop up asking you if you want to restore, click Yes
- A prompt should pop up asking you for user password. Enter the root password here.
A window titled Restore Settings (as superuser) should pop up
- Navigate to the snapshot you want to restore and select it (The path to the snapshot should show up in green at the bottom.)
- Click Restore
- Click OK
A window titled Back in Time (as superuser) should pop up
- Select the right snapshot
- Then, select the folder you want to restore
- Click Restore
- A window titled Question (as superuser) should pop up
- Click Yes
- At last, a log will pop up, that you can close by clicking Close
You're done!
Using Back in Time from the command line
To back up:
backintime backupTo list options run:
backintime -h
Comment
This is the simplest way to backup and restore. Please take a look at other options e.g. Mode, Schedule, et cetera.
Using rsync
To make a backup of your home directory using rsync you can use the following example:
First, create a directory on a mounted drive. For example, run the following command in a terminal, where /media/trisquel/backup/home/$USER/ is the target we want to use later:
mkdir -p /media/trisquel/backup/home/$USER/Second, run rsync, where /home/$USER/ is the source and /media/trisquel/backup/home/$USER/ is the target. Make sure not to forget the / at the end of them, that will mark them as a directory. The following command will exclude the .cache directory, because in most cases it is not needed.
rsync -av --exclude=.cache /home/$USER/ /media/trisquel/backup/home/$USER/To restore a backup you can use rsync again.
rsync -av /media/trisquel/backup/home/$USER/ /home/$USER/Adapt this examples to your needs!
Notes
For your security, you should only store your data on a device you control, e.g. an external drive.
Attachment | Size |
---|---|
back-in-time-initiate-backup-1.png | 19.57 KB |
back-in-time-initiate-backup-2.png | 44.15 KB |
back-in-time-initiate-backup-3.png | 34.48 KB |
back-in-time-initiate-backup-4.png | 37.25 KB |
back-in-time-initiate-backup-5.png | 92.23 KB |
back-in-time-initiate-backup-6.png | 53.62 KB |
back-in-time-restore-backup-1.png | 21.21 KB |
back-in-time-restore-backup-2.png | 61.54 KB |
back-in-time-restore-backup-3.png | 45.78 KB |
back-in-time-restore-backup-4.png | 86.11 KB |
back-in-time-restore-backup-5.png | 85.02 KB |