Latest LQ Deal: Linux Power User Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 05-25-2015, 08:38 AM   #1
Registered: Mar 2015
Distribution: Arch
Posts: 60

Rep: Reputation: Disabled
rsync, reliable "copy and paste" type of backup in case things break?

What I did in windows was create images of my drive and restore them.

in linux I am running

rsync -aAXv --exclude={"/home/*","/dev/*","/proc/*","/sys/*","/tmp/*","/run/*","/mnt/*","/media/*","/lost+found"} /* /path/to/backup/folder
and this creates a folder for me with all my files, and apparently saves meta data like permissions and paths...

Since I'm using arch and things break sometimes,I'm booted into a CLI with errors and cannot figure my way out since I'm a noob... would I be able to just delete my entire root and replace it with the rsync backup without a problem?
Old 05-25-2015, 09:16 AM   #2
LQ Newbie
Registered: May 2015
Location: Ghana, West Africa
Distribution: Slackware 14.1 (ish)
Posts: 11

Rep: Reputation: Disabled
Your backup method seems a bit odd.. Do you still have the images you made of your Linux installation, or was it an image of your whole device?

For backups, I usually recommend writing a BASH script which can be automated by the cron service. In plain English that means: write a BASH script which locates and copies your /home directory and edited configuration files (not all of /etc, just .conf files I may have changed) to a "Backup" folder. Compress with tar, saving permissions with the "-p" flag at least. It must be created with root and extracted by root, as a user cannot change permissions above him/herself.

The script should then remove the files copied and store, move or upload your compressed backup to wherever you want. Using BASH and various ftp software, you can automate a secure uploaded backup to a remote server, and have it check for old versions older than 1 week, 2 weeks, etc for deletion. Other options are to have the script check to see if your backup drive is plugged in around 12am-4am every 30-45 minutes using hardware ID or mountpoint (latter works but is sloppy) and mirror/move backups to drive.

For a seamless recovery, a script can be included in your backup to backup config files, move in ones from backup and copy over /home directory. It could then run "adduser" to recreate your account and subsequently change permissions/ownership of user directories back to "you".

Last edited by devnod12; 05-25-2015 at 09:18 AM.
Old 05-25-2015, 08:07 PM   #3
Fred Caro
Registered: May 2007
Posts: 999

Rep: Reputation: 166Reputation: 166
You seem to have tried to exclude an awful lot, why?
Gfl (ghost for linux) will create an image that you can overwrite a drive with, probably a partition, I've never used it.
Rsync does incremental backups. On restore it (as I understand it) puts back what is missing but will not correct damaged files. I use rsync to backup data and restore just that data to the new/repaired system.

Old 05-25-2015, 09:00 PM   #4
LQ Veteran
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 15,549

Rep: Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042Reputation: 2042
Originally Posted by PACMANchasingme View Post
would I be able to just delete my entire root and replace it with the rsync backup without a problem?
Seems definitive enough.
Short answer - yep, looks like it should work. Might toss up a few curly issues (PID files, boot loader) but seems reasonable. Not much different to taking a snapshot and rolling back - just a lot more effort ...
(well not quite the same - rsync only does disk-resident files. It has no knowledge of what's cached in memory).

Last edited by syg00; 05-25-2015 at 09:20 PM. Reason: last comment


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] unable to copy paste & Help in editing "sources.list" file Piyush M Debian 18 01-18-2013 04:40 PM
Can I "Back up" my system by copy and paste? (ext4) pgibsonorg Linux - General 6 05-27-2012 06:32 AM
[SOLVED] need to copy all " *.SEED " files and paste them inside a new folder each time rastin_nz Programming 1 11-03-2010 05:02 PM
Disable xorg's "highlight to copy, middle click to paste" clipboard tromboneman Linux - Newbie 1 06-08-2008 11:53 AM
How do i "copy" one bios and "paste" it onto another identical machine Yerp Linux - Hardware 2 01-10-2007 08:31 PM

All times are GMT -5. The time now is 10:38 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration