Thanks for the info guys, I really like the idea of analyzing the dry run.

In this case backup up trash was a problem even though I'm using rsync as
I've been doing a lot of sorting/editing/purging of my photos.  Lots of new
material in the trash each time I run backup.  Plus all the stuff that's in
trash is still taking up space I'd rather not consume.

One thing I thought I'd share is how I do snapshots with rsync while
minimizing backup media use with the use of the -l tag for cp.  It makes a
hard link to the files it's copying, so if a file doesn't change across
snapshots then it doesn't take up more space across the multiple backups.
Here's a block from my script demonstrating this:

#backup azrael:/home/john
echo "Delete azrael backup 3"
sudo rm -rf /media/1TB/azrael.home.backup.3
echo "Move azrael backup 2 to backup 3"
sudo mv /media/1TB/azrael.home.backup.2 /media/1TB/azrael.home.backup.3
echo "Move azrael backup 1 to backup 2"
sudo mv /media/1TB/azrael.home.backup.1 /media/1TB/azrael.home.backup.2
echo "Copy azrael backup 0 to backup 1"
sudo cp -al /media/1TB/azrael.home.backup.0 /media/1TB/azrael.home.backup.1
echo "Backup azrael to backup 0"
rsync -avP --delete /home/john/ /media/1TB/azrael.home.backup.0/
echo "Backup azrael complete."

All the comments are because I run my backups manually, and I like to know
what it's doing when it's just sitting there apparently doing nothing.



On Sun, Feb 23, 2014 at 10:08 PM, Eric Myers <[email protected]> wrote:

> On Thu, 20 Feb 2014, John Mort wrote:
>
>  I run rsync to backup my Ubuntu machines periodically.
>>
>
> I did the same when I didn't have only one machine running, though I'm on
> Fedora.   Here is the script, which I called cronsync.
>
> #!/bin/sh -f
> # @(#) last changed -EAM 26Sept2008
> PATH=$PATH:/usr/local/bin
> export PATH
> #DEL=""
> DEL="--delete"
> EXCLUDE="--exclude-from=cronsync.exclude"
> FLAGS="-aqzHx  -e ssh  --exclude-from=$EXCLUDE  --delete "
> #####
> # Backup (mirror) user files # Pull from skye: rsync  $FLAGS
> skye:/home/myers/   /archive2/backups/skye/home/myers/ #
>
>
> The --exclude-from=  lets you specify a list of files or glob patterns for
> what to exclude.  Unfortunately I've lost that file, but it was something
> like
>
> #*#
> .#*
> *~
> *-
> *.bak
> *.log
> *.tmp
> *.ORIG
> *.OLD
> a.out
> *.o
> core
>
>
> The other thing to note is the --delete, which will delete in the copy any
> file that is not in the original.   For backups you may want to not use
> that, so that you can recover a file that you accidentally deleted.
>
>
>  Watching the backup run today, I noticed that I'm backing up everything in
>> ~/.local/share/Trash is being backed up.  This is both unnecessary, and
>> makes the backup take a lot longer than it otherwise would since I only
>> empty the trash when I'm running out of space.
>>
>
> One great thing about rsync is that it only copies over the files that
> have changed, so you are not copying the entire trash bin each time.
> And since it runs in the middle of the night I don't care anyway.
>
> -Eric
>
>
>
> --
> Eric Myers            <[email protected]>      845-475-8176
>
> PGP Key #6E2D2259/RSA: BA39 1D46 5EC3 0D59 C2AC 6FCB F920 4DC8
> PGP Key #E519EAC3/DSS: D15B 9A50 B1ED 2947 EC29 B0F6 EA61 FB6E E519 EAC3
>
>
> _______________________________________________
> Mid-Hudson Valley Linux Users Group                  http://mhvlug.org
> https://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug
>
> Upcoming Meetings (6pm - 8pm)                         Vassar College
>  Mar 5 - 11th Anniversary Meeting - Home Network Show and Tell
>  Apr 2 - Nginx: High-Performance HTTP Server, Reverse Proxy, and IMAP/POP3
> Proxy Server
>  May 7 - Google App Engine
>
_______________________________________________
Mid-Hudson Valley Linux Users Group                  http://mhvlug.org
https://mhvlug.org/cgi-bin/mailman/listinfo/mhvlug

Upcoming Meetings (6pm - 8pm)                         Vassar College
  Mar 5 - 11th Anniversary Meeting - Home Network Show and Tell
  Apr 2 - Nginx: High-Performance HTTP Server, Reverse Proxy, and IMAP/POP3 
Proxy Server
  May 7 - Google App Engine

Reply via email to