Grsync backups of root and /home

Write tutorials here
There are more tutorials here http://community.linuxmint.com/tutorial/welcome
Forum rules
Please don't add support questions to tutorials,start your own thread in the appropriate sub-forum instead. Before you post please read this
User avatar
austin.texas
Level 20
Level 20
Posts: 11034
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Grsync backups of root and /home

Postby austin.texas » Fri Feb 05, 2016 9:56 pm

[TUTORIAL] Grsync backups of root and /home

Grsync does incremental backups, so only the new and modified files are backed up each time. Once it is configured, it only takes a few clicks to perform the backup. The configurations are saved as "Sessions" and only have to be configured once. Your configuration will still be there the next time you open the program.

STEP 1:

Code: Select all

sudo apt-get install grsync


Part 1: backup of a root partition.
To identify the device designation of the root partition, run the command:

Code: Select all

inxi -dpo


My results show the / partition as /dev/sda2, and the backup location as /dev/sdc2, mounted at /media/dan/usb_drive

Code: Select all

Partition:
     ID-1: / size: 31G used: 12G (40%) fs: ext4 dev: /dev/sda2
     ID-5: /media/dan/usb_drive size: 407G used: 174G (46%) fs: ext4 dev: /dev/sdc2
     ID-6: swap-1 size: 9.25GB used: 0.00GB (0%) fs: swap dev: /dev/sdb3


EDIT: The mount point is likely owned by root, so you have to change the ownership to the current user, with the command:

Code: Select all

sudo chown $USER:$USER /media/yourusername/mountpoint
(using your actual user name, and the correct name of the mount point)

Create a folder on the backup drive:

Code: Select all

sudo mkdir /media/dan/usb_drive/RootPartitionBackup


Open Grsync: Menu > Administration > Grsync
Click on Sessions > Add
Give your backup session a name - mine is RootPartitionBackup
Enter the source - /
Enter the path to the backup location - /media/dan/usb_drive/RootPartitionBackup
Select your options below.
Grsync1.png


Click the Advanced Options tab.
In the text box enter:
--exclude '/cdrom'
--exclude '/dev'
--exclude '/home'
--exclude '/lost+found'
--exclude '/media'
--exclude '/mnt'
--exclude '/proc'
--exclude '/run'
--exclude '/sys'
--exclude '/tmp'
--exclude '/.cache'
--exclude '/.Trash-0'

Grsync2.png


This will exclude the running, variable parts of your system, which should not be backed up, and will exclude any mounted partitions.
/home is excluded on the assumption that /home will be backed up separately, on a more frequent schedule.
/.Trash-0 may have a different name on your system.

The Advanced Options include the choice of compressing the backup.
Clicking the "i" icon will give you a report on what will be done, without actually executing the backup. (dry-run)
When you see that everything is configured the way you want it, click the "Execute" icon.
Last edited by austin.texas on Mon Apr 11, 2016 10:38 am, edited 5 times in total.
Mint 18.1 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Microsoft-free environment since 1996

Linux Linx 2017

User avatar
austin.texas
Level 20
Level 20
Posts: 11034
Joined: Tue Nov 17, 2009 3:57 pm
Location: at /home

Re: Grsync backups of root and /home

Postby austin.texas » Fri Feb 05, 2016 9:58 pm

Part 2: backup of a separate /home or /data partition.
Click on Sessions > Add
Give your backup session a name - mine is Toshiba
Enter the source - /home
Enter the path to the backup location - /media/dan/usb_drive
Select your options below.
Grsync4.png


Click the Advanced Options tab.
In the text box enter:
--exclude '.cache'
--exclude '.local/share/Trash'
--exclude '.thumbnails'
--exclude '.gvfs'
Grsync3.png


You can add more folders to be excluded.
Excluded folders can be:
.local/share/wineprefixes
.thunderbird/xtjje1ch.default/Cache
.thunderbird/xtjje1ch.default/startupCache
.gconf
.googleearth
.kde
.kdeconf
.macromedia
.mateconf
.wine
.wine-pipelight
.PlayOnLinux
.VirtualBox
Dropbox

For a /data partition, change "/home" to the correct path to the directories being backed up.
EXAMPLE: /media/dan/sdb2_data/Music

When you have the configuration the way you want it, click the "Execute" icon.
---------------------------------------------------------------------
Forum rules:
Please don't add support questions to tutorials, start your own thread in the appropriate sub-forum instead.
Mint 18.1 Cinnamon, Quad core AMD A8-3870 with Radeon HD Graphics 6550D, 8GB DDR3, Ralink RT2561/RT61 802.11g PCI
Microsoft-free environment since 1996

Linux Linx 2017


Return to “Tutorials”

Who is online

Users browsing this forum: No registered users and 8 guests