| Author |
Message |
|
|
Post subject: sync & backup with "rsync"
Posted: Sep 03, 2008 - 03:06 PM
|
|

Joined: Aug 03, 2008
Posts: 30
Location: Athens, Greece
Status: Offline
|
|
This script synchronizes and/or backs-up any directories using rsync.
1. Sync
Sync any directories keeping the files that were most recently modified on both of them.
Useful if you modify files on more than one PCs using a flash-drive and don't want to bother remembering what did you use last.
Careful: if you delete a file in one directory it's not going to be deleted in the other. Any files that exist in one folder is going to apear in the other after the sync.
The rsync options used are:
Code:
rsync -h --archive --progress --stats --update
2. Backup
Backup any directory (source) to another (destination).
If run for the first time it's gonna take quite a long time depending on the size of the source directory.
But then, rsync just copies over the changes you've made. That means adding, moving, deleting, modifing etc.
Owner, group, time stamps, links and permissions of files are preserved at the destination directory.
That means that you're gonna have a "clone" of your source dirs at another location in no time !!
The rsync options used are:
Code:
rsync -h --archive --progress --stats --update --delete-after
3. Keeping your data safe.
The script first checks if the directories you've declared exist and if they are empty and warns you accordingly.
You wouldn't want your 500GB music collection backup (that took half a day to create) vanish in a second if you forgot to mount the external drive that your source is in !!
You also wouldn't want to execute an rsync command if your destination folder is in an external drive that you also forgot to mount.
4. Declaring directories
Just edit the script file between the lines
Code:
# ==============================================================================================================
# ------------------------------------------ user input --------------------------------------------------------
# ==============================================================================================================
and
Code:
# user input end-----------------------------------------------------------------------------------------------
First declare all folder pairs that are going to be synced. e.g:
Code:
syncdirA[${#syncdirA[*]}]="/media/USBstick/UCL/project"
syncdirB[${#syncdirB[*]}]="/home/luckyb/UCL/project"
#syncdirA[${#syncdirA[*]}]="path/to/2nd/syncdirA"
#syncdirB[${#syncdirB[*]}]="path/to/2nd/syncdirB/"
and then the source and destination directories for the backup. e.g:
Code:
sourcedir[${#sourcedir[*]}]="/home/luckyb/mp3/"
destdir[${#destdir[*]}]="/media/backups/mp3/"
sourcedir[${#sourcedir[*]}]="/media/externalHDD/photos/"
destdir[${#destdir[*]}]="/media/backups/personal/photos/"
sourcedir[${#sourcedir[*]}]="/home/luckyb/"
destdir[${#destdir[*]}]="/media/backups/sidux/home/"
#sourcedir[${#sourcedir[*]}]="/path/to/4rth/source/dir/"
#destdir[${#destdir[*]}]="/path/to/4th/dest/dir/"
use as many pairs as you like.
Be careful with the use of "/" after the directory path.
Use the '/' character at the end of the sourcedir and destdir not to copy 'root' source but only subfolders and files
Example:
The following will backup /home/luckyb/mp3 to /media/backups/ - a directory /media/backups/mp3 will be Created
The directory /home/luckyb/photos will be backed up to /media/backups/luckyb_photos - All contents of the /home/luckyb/photos directory will be backedup but no photos directory will be created in /media/backups/luckyb_photos
Code:
sourcedir[${#sourcedir[*]}]="/home/luckyb/mp3"
destdir[${#destdir[*]}]="/media/backups"
sourcedir[${#sourcedir[*]}]="/home/luckyb/photos/"
destdir[${#destdir[*]}]="/media/backups/luckyb_photos/"
Save the file and make it executable (e.g: chmod +x luckyBackup.sh)
Run it
here are some screenshots:
 |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: sync & backup with "rsync"
Posted: Oct 09, 2008 - 02:20 PM
|
|

Joined: Aug 03, 2008
Posts: 30
Location: Athens, Greece
Status: Offline
|
|
There is a graphical implementation of luckyBackup released...
The project's web page is: http://luckybackup.sourceforge.net/
I hope we'll see it in sidux repos one day
 |
Last edited by luckyb on Oct 11, 2008 - 09:53 PM; edited 1 time in total
|
| |
|
|
|
 |
|
|
Post subject: RE: sync & backup with "rsync"
Posted: Oct 09, 2008 - 06:07 PM
|
|

Joined: Jul 06, 2008
Posts: 9
Location: Milan(Italy)
Status: Offline
|
|
start using today. I hope it can help me to increase the attitude TO DO back up .
Thanks for your great application. |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: sync & backup with "rsync"
Posted: Oct 09, 2008 - 06:14 PM
|
|

Joined: Jun 17, 2007
Posts: 502
Location: Buchholz i.d.N.
Status: Offline
|
|
|
|
|
 |
|
|
Post subject: RE: sync & backup with "rsync"
Posted: Oct 09, 2008 - 06:20 PM
|
|

Joined: Aug 03, 2008
Posts: 30
Location: Athens, Greece
Status: Offline
|
|
People trying my app and moreover finding it useful really puts a smile on my face
<-- smile on luckyb's face
I would be grateful if you find the time to report any comments ("it works on my system", "its useless", "I wish there was a deb file", "the gui sucks" or anything ...)
Just a couple of minutes of your time means a great deal to me
thanks  |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: sync & backup with "rsync"
Posted: Oct 09, 2008 - 06:29 PM
|
|

Joined: Jun 17, 2007
Posts: 502
Location: Buchholz i.d.N.
Status: Offline
|
|
|
|
|
 |
|
|
Post subject: RE: sync & backup with "rsync"
Posted: Oct 09, 2008 - 06:45 PM
|
|

Joined: Aug 03, 2008
Posts: 30
Location: Athens, Greece
Status: Offline
|
|
I am wondering the same thing !!
<u>It does not have the same effect on my iceweasel.</u> I can click, save images, etc normally.
This is my first web site creation attempt, so if I have made sth stupid and anybody has a clue on how to fix it please advice. |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: sync & backup with "rsync"
Posted: Oct 09, 2008 - 06:48 PM
|
|

Joined: Jun 17, 2007
Posts: 502
Location: Buchholz i.d.N.
Status: Offline
|
|
I'm not website-specialist but I'm careful with scripts that need root privileges on my system, especially when
they are from an author who a) never posted here before and b) which website triggers alarms in my
iceweasel.  |
_________________ - stell @ jabber.crashmail.de -
[blog.crashmail.de] [last.fm-Profil]
|
| |
|
|
|
 |
|
|
Post subject: RE: sync & backup with "rsync"
Posted: Oct 09, 2008 - 06:54 PM
|
|

Joined: Aug 03, 2008
Posts: 30
Location: Athens, Greece
Status: Offline
|
|
checking into it mate..
I created the hole thing with bluefish & ooo and seems like I 've done sth stupid.
please bare with me until I figure this out. Meanwhile if anybody has a suggestion...
PS Yes, I am unforgivable. I should have posted more often here  |
|
|
| |
|
|
|
 |
|
|
Post subject: Re: RE: sync & backup with "rsync"
Posted: Oct 09, 2008 - 07:03 PM
|
|

Joined: Nov 30, 2006
Posts: 3442
Location: Budapest
Status: Offline
|
|
|
Steve` wrote:
You all seem to be a funny bunch of people.
Please refrain from imageshack as well. I get this nice popup by clicking on your imageshack link. This is a 1kB file, no idea what it is, and iceweasel simply does not know it either:
So please, imageshack users: make direct links to your pics. Last year imageshack users on sidux.com at least provided me with my yearly dosis of pr0n ads. Which was more fun than boring download popups. Though the sidux fora were rated 18+ then
Btw: my nocscript does reproduce your popup as well.
I missed the popup the first time, too many windows open here.
hubi |
_________________ Bonitas stultitiaque sodales sunt.
Last edited by hubi on Oct 09, 2008 - 07:09 PM; edited 1 time in total
|
| |
|
|
|
 |
|
|
Post subject: RE: sync & backup with "rsync"
Posted: Oct 09, 2008 - 07:04 PM
|
|

Joined: Aug 03, 2008
Posts: 30
Location: Athens, Greece
Status: Offline
|
|
It's not that terrifying !!
seems like I screwed up the documentation part (all the others are ok) and there are some "hidden" elements.
Basically it's the pictures covering part of sth else. There is no script demanding root privileges !!
Please excuse my html ignorance.
--edit: thank u hubi. just saw your post |
|
|
| |
|
|
|
 |
|
|
Post subject: Re: RE: sync & backup with "rsync"
Posted: Oct 09, 2008 - 07:10 PM
|
|

Joined: Nov 30, 2006
Posts: 3442
Location: Budapest
Status: Offline
|
|
|
luckyb wrote:
--edit: thank u hubi. just saw your post
Sorry, wrong negative, the pop up was hidden behind some other windows. It is there.
hubi |
_________________ Bonitas stultitiaque sodales sunt.
|
| |
|
|
|
 |
|
|
Post subject: RE: Re: RE: sync & backup with "rsync"
Posted: Oct 09, 2008 - 08:35 PM
|
|

Joined: Aug 03, 2008
Posts: 30
Location: Athens, Greece
Status: Offline
|
|
Well, I'm trying to fix it.
This happens just at the documentation part. The others are ok.
...but got fed up with html tags, evrything is becoming blurry and cannot distinguish characters any more
will try again tomorrow.
Thank you for noticing that.
Terrifying messages are no good for my website.
It's a pity people are discouraged from this app because I'm useless as far as websites are concerned. |
|
|
| |
|
|
|
 |
|
|
Post subject: RE: Re: RE: sync & backup with "rsync"
Posted: Oct 10, 2008 - 08:31 AM
|
|
Team Member

Joined: Nov 24, 2006
Posts: 1990
Location: w3
Status: Offline
|
|
We run our own user image gallery over here, where all registered users can set up their own album and easily upload pictures. Those pictures can then be directly linked into the forum with a relative path with no 3rd party involved and no ads shown. Here is a little HowTo I posted.
As our code of conduct clearly states, advertising in our forums is forbidden, and I consider imageshack (and all those other ad-driven "free" services) as such. If people do not stop using it here, we will have to ban it by script.
Greetings,
Chris |
_________________ 64bit stuff for sidux
development is life - code.zikula.org
an operating system must operate - sidux.com
|
| |
|
|
|
 |
|
|
Post subject: RE: Re: RE: sync & backup with "rsync"
Posted: Oct 10, 2008 - 10:29 AM
|
|

Joined: Jun 17, 2007
Posts: 502
Location: Buchholz i.d.N.
Status: Offline
|
|
| Services like ImageShack are against the sidux code of conduct? You must be jokin'? To add a service-hosted screenshots here has nothing to do with any kind of advertising. If this is violating the code of conduct 98% of all other links are violating the sidux codex too. |
_________________ - stell @ jabber.crashmail.de -
[blog.crashmail.de] [last.fm-Profil]
|
| |
|
|
|
 |
|
|