Rsync sequence

2010-07-19 Thread dschuett

Hi all,

I am running Ubuntu server 10.04 and use rsync to do all my backups. I would
like to backup multiple directories to my external hard drive, but I am
faced with a problem on how to set up crontab -e to allow each rsync
statement to perform one after the other. Right now I have each one set to
run on different nights, but I would like them all to run the same night to
allow for a more efficient backup. I know I could just run them at different
times in the same night, but I don't want to chance one not completing
before the other starts. Can I just list them one after the other like so in
crontab -e:

# m h  dom mon dow   command
00 4 * * 7 rsync -auv --delete /Godfather/Music /Backup
 rsync -auv --delete /Godfather/Documents /Backup
 rsync -auv --delete /Godfather/Setups /Backup
 rsync -auv --delete /Godfather/Pictures /Backup
 rsync -auv --delete /Godfather/Backups /Backup
 rsync -auv --delete /Godfather/Videos /Backup

This is my current crontab -e
# m h  dom mon dow   command
00 4 * * 7 rsync -auv --delete /Godfather/Music /Backup
00 4 * * 6 rsync -auv --delete /Godfather/Documents /Backup
00 4 * * 5 rsync -auv --delete /Godfather/Setups /Backup
00 4 * * 4 rsync -auv --delete /Godfather/Pictures /Backup
00 4 * * 3 rsync -auv --delete /Godfather/Backups /Backup
00 4 * * 2 rsync -auv --delete /Godfather/Videos /Backup

Thanks in advance!
-- 
View this message in context: 
http://old.nabble.com/Rsync-sequence-tp29210771p29210771.html
Sent from the Samba - rsync mailing list archive at Nabble.com.

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: --compare-dest weirdness

2010-07-19 Thread Henri Shustak
> interestingly, i tried to see if something was wrong with my statments by 
> doing:
> mkdir ~/rsynctest/dir1
> mkdir ~/rsynctest/dir2
> mkdir ~/rsynctest/dir3
> 
> nano ~/rsynctest/dir1/file1 (wrote the line hello world and saved)
> nano ~/rsynctest/dir1/file2 (wrote the line hello and saved)
> 
> cp ~/rsynctest/dir1/file* ~/rsynctest/dir2/
> 
> checked md5sums of both files in both dirs to ensure they were identical
> 
> the did rsync -rvu --compare-dest=/home/kevin/rsynctest/dir2/
> /home/kevin/rsynctest/dir1/ /home/kevin/rsynctest/dir3/
> 
> the two files from dir1 were copied to dir3, even though identical
> copies, with the same names, existed in dir2.
> 
> i also tried this again with the compare dir relative to the dest dir,
> i.e.: rsync -rvu --compare-dest=../dir2/ /home/kevin/rsynctest/dir1/
> /home/kevin/rsynctest/dir3/ again with same result



I thought about this further and I think the problem you are having is that the 
modification times are not being preserved and you are not using the --checksum 
option. 

As such, I suggest that you add the --times or --checksum option and see if 
that helps. 

I suspect that this will solve your problem. Let me know =:^)


-
This email is protected by LBackup, an open source backup solution. 
Free as in freedom; LBackup is licensed under the GNU GPL
http://www.lbackup.org


-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: Rsync backup issues using relative paths and LVM snapshots

2010-07-19 Thread Henri Shustak
>> I did think about remotely executing a mkdir before the backup, but one 
>> blocker is that I will be using Thecus NAS boxes as some off-site locations 
>> and I don't have shell access.
> 
> You could mkdir the directory locally somewhere (anywhere), and rsync
> just that directory to the remote side, affectively doing a remote mkdir
> via rsync.  Repeat for deeper directories. If the remote directory
> already exist, it shouldn't do any harm.



Great thinking! That would certainly work. Such an elegant approach!

This would even work if you want to create a hierarchy you just need to use the 
rsync --recursive option.


-
This email is protected by LBackup, an open source backup solution. 
Free as in freedom; LBackup is licensed under the GNU GPL
http://www.lbackup.org

-- 
Please use reply-all for most replies to avoid omitting the mailing list.
To unsubscribe or change options: https://lists.samba.org/mailman/listinfo/rsync
Before posting, read: http://www.catb.org/~esr/faqs/smart-questions.html


Re: --compare-dest weirdness

2010-07-19 Thread Henri Shustak

> Hi All,
> 
> I am writing a backup program for my computer. brief outline is as follows.
> 
> Running ubuntu 10.04
> 2 main partitions, / and /home, both ext3. 1 external usb hdd, ext3,
> mounted to /backups/main.
> once every couple of days, rsync backs up, using following command,
> everything worth backing up in / and /home partitions to a folder
> /backups/main/Full. command: "rsync -vrhRupElog --delete-during
> --delete-excluded --exclude-from=/backups/.config/full.exclude
> --log-file=/backups/.logs/full.rlog / /backups/main/Full/". this works
> perfectly
> 
> now what i want to do, is every few hours, rsync ONLY the files
> changed in the last few days to a folder in
> /backups/main/Incremental/MMddTHHmm, where the ... is a string
> representing the date and time. (and then tar.gz the previous
> directory to save space) the command i am using for this is : "rsync
> -vrhRupElog --delete-during --delete-excluded
> --exclude-from=/backups/.config/incremental.exclude
> --log-file=/backups/.logs/incremental.rlog
> --compare-dest=/backups/main/Full/ /
> /backups/main/Incremental/Full/20100716T1355" the incremental.exclude
> differs from the full.exclude only in that i also exclude .mp3, .avi
> and other large and non-critical file types.
> 
> the problem is that rsync is behaving as though it is ignoring the
> compare-dest option. it throws no error about this dir not existing,
> and i have tried giving it as a relative dir to the destination with
> same result.
> 
> interestingly, i tried to see if something was wrong with my statments by 
> doing:
> mkdir ~/rsynctest/dir1
> mkdir ~/rsynctest/dir2
> mkdir ~/rsynctest/dir3
> 
> nano ~/rsynctest/dir1/file1 (wrote the line hello world and saved)
> nano ~/rsynctest/dir1/file2 (wrote the line hello and saved)
> 
> cp ~/rsynctest/dir1/file* ~/rsynctest/dir2/
> 
> checked md5sums of both files in both dirs to ensure they were identical
> 
> the did rsync -rvu --compare-dest=/home/kevin/rsynctest/dir2/
> /home/kevin/rsynctest/dir1/ /home/kevin/rsynctest/dir3/
> 
> the two files from dir1 were copied to dir3, even though identical
> copies, with the same names, existed in dir2.
> 
> i also tried this again with the compare dir relative to the dest dir,
> i.e.: rsync -rvu --compare-dest=../dir2/ /home/kevin/rsynctest/dir1/
> /home/kevin/rsynctest/dir3/ again with same result
> 
> is this a bug, or have i got the wrong end of the stick regarding 
> --compare-dir?
> 

Hopefully, someone on the list will be able to provide you with some further 
details regarding what is happening. 

In the mean time I suggest that you consider looking at rsnapshot, rdiffbackup, 
link-backup or LBackup.

All of the projects listed above and many more are listed at the following URL 
: http://www.lbackup.org/alternatives

Certainly, with LBackup (disclaimer - I am a developer on this project) you are 
able to configure the backup to have just one or two hard linked rotations by 
specifying the following in the backup configuration file : 

numRotations=1 # only the most recent successful backup will be kept
numRotations=2 # only the two most recent successful backups will be kept

LBackup will save space even if you save 50, 500 or 1000 backups due to hard 
linking files which have not been changed or moved. The one issue is that it is 
important not to exceed the your file systems inode limits.

With regards the creation of your compressed tar you could add a post action 
into the resources/post-actions directory of your configuration directory and 
create a compressed tar of the most recent backup. If you wanted to you could 
even rsync this backup to one or more remote systems. The post action sub 
system of each LBackup configuration directory makes this kind of customized 
setup trivial. For example there is post action script bundled with LBackup 
which will generate these dated linked directories within your backup set. The 
example script is called : 
BACKUP-300-Generate-Time-Based-Backup-Links-Directory.bash

This script makes altering the format of the links, having multiple  formats or 
different formats for different a snap.

If you are quite sure you want to roll your own rsync based backup then that is 
fantastic.

The only suggestions I have with regards why your current system is not working 
is that perhaps trying the --link-dest rather than the --compare-dest option 
may provide some further insight into what is not working. However, I see no 
reason why one would work while the other would not.

I also suggest that you try to check why the files are being updated and not 
matched by adding the --itemize-changes option. This option should provide some 
further details. In addition, you may want to also add some additional 
verbosity by adding -vvv as an option. You currently have just one -v.

Are you running rsync as root or as a non-privilged user. I assume you are 
running as root because you are using the --owner and --group options. Would 
you confirm