FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 05-29-2010, 09:01 AM
Mick
 
Default rsync to a USB stick

Hi All,

I run:

rsync -a -l --delete -v /mnt/Business_dir /media/sdf1

to back up a directory from a PC to a USB stick. However, from a cursory look
this *seems* to copy the complete directory (every time I run it) and
overwrites the USB stick. Carrying on like this it will life-expire the USB
stick in no time, plus it takes ages to complete as it copies over every
single file again and again.

Is there a cleverer option I can add to rsync so that it only copies new
files, overwrites older versions of the same and only deletes any files or
directories that have been deleted from the source directory?
--
Regards,
Mick
 
Old 05-29-2010, 09:20 AM
 
Default rsync to a USB stick

Mick <michaelkintzios@gmail.com> [10-05-29 11:12]:
> Hi All,
>
> I run:
>
> rsync -a -l --delete -v /mnt/Business_dir /media/sdf1
>
> to back up a directory from a PC to a USB stick. However, from a cursory look
> this *seems* to copy the complete directory (every time I run it) and
> overwrites the USB stick. Carrying on like this it will life-expire the USB
> stick in no time, plus it takes ages to complete as it copies over every
> single file again and again.
>
> Is there a cleverer option I can add to rsync so that it only copies new
> files, overwrites older versions of the same and only deletes any files or
> directories that have been deleted from the source directory?
> --
> Regards,
> Mick

Hi,

this is really a shot in the dark, but...
Would it possible, that the USB-stick is carrying a filesystem, which
lacks the support of enough ijnformations, rsync needs to operate
corrrectly (especially: file times?
Concerning the wear out of usb-sticks (and flash media in general):
There are specialised filesystems out there (dont remember what
exactly their names were), which take care of a "flashy" environment
(spread writes to different parts each time),

HTH!

Best regards,
mcc



--
Please don't send me any Word- or Powerpoint-Attachments
unless it's absolutely neccessary. - Send simply Text.
See http://www.gnu.org/philosophy/no-word-attachments.html
In a world without fences and walls nobody needs gates and windows.
 
Old 05-29-2010, 09:30 AM
Alan McKinnon
 
Default rsync to a USB stick

On Saturday 29 May 2010 11:01:39 Mick wrote:
> Hi All,
>
> I run:
>
> rsync -a -l --delete -v /mnt/Business_dir /media/sdf1
>
> to back up a directory from a PC to a USB stick. However, from a cursory
> look this *seems* to copy the complete directory (every time I run it) and
> overwrites the USB stick. Carrying on like this it will life-expire the
> USB stick in no time, plus it takes ages to complete as it copies over
> every single file again and again.
>
> Is there a cleverer option I can add to rsync so that it only copies new
> files, overwrites older versions of the same and only deletes any files or
> directories that have been deleted from the source directory?

What filesystem is on the disk?

If it's FAT, rsync will not benefit as FAT does not have any notion of the
metadata that is on the PCs disk


--
alan dot mckinnon at gmail dot com
 
Old 05-29-2010, 09:30 AM
Alan McKinnon
 
Default rsync to a USB stick

On Saturday 29 May 2010 11:01:39 Mick wrote:
> Hi All,
>
> I run:
>
> rsync -a -l --delete -v /mnt/Business_dir /media/sdf1
>
> to back up a directory from a PC to a USB stick. However, from a cursory
> look this *seems* to copy the complete directory (every time I run it) and
> overwrites the USB stick. Carrying on like this it will life-expire the
> USB stick in no time, plus it takes ages to complete as it copies over
> every single file again and again.
>
> Is there a cleverer option I can add to rsync so that it only copies new
> files, overwrites older versions of the same and only deletes any files or
> directories that have been deleted from the source directory?


Arg, typo in previous post. I meant what filesystem is on the USB stick?


--
alan dot mckinnon at gmail dot com
 
Old 05-29-2010, 09:39 AM
Steven
 
Default rsync to a USB stick

On Sat, May 29, 2010 at 2:01 AM, Mick <michaelkintzios@gmail.com> wrote:

Hi All,



I run:



*rsync -a -l --delete -v /mnt/Business_dir /media/sdf1



to back up a directory from a PC to a USB stick. *However, from a cursory look

this *seems* to copy the complete directory (every time I run it) and

overwrites the USB stick. *Carrying on like this it will life-expire the USB

stick in no time, plus it takes ages to complete as it copies over every

single file again and again.



Is there a cleverer option I can add to rsync so that it only copies new

files, overwrites older versions of the same and only deletes any files or

directories that have been deleted from the source directory?

--

Regards,

Mick

Short answer "man rsync"
You'll find everything you need.
It is possible to sync files incrementally with rsync I just can't remember how right now
Sorry really tired right now. Im sure someone will come a long with a more appropriate answer.
 
Old 05-29-2010, 09:39 AM
Mick
 
Default rsync to a USB stick

On Saturday 29 May 2010 10:30:54 Alan McKinnon wrote:
> On Saturday 29 May 2010 11:01:39 Mick wrote:
> > Hi All,
> >
> > I run:
> >
> > rsync -a -l --delete -v /mnt/Business_dir /media/sdf1
> >
> > to back up a directory from a PC to a USB stick. However, from a cursory
> > look this *seems* to copy the complete directory (every time I run it)
> > and overwrites the USB stick. Carrying on like this it will life-expire
> > the USB stick in no time, plus it takes ages to complete as it copies
> > over every single file again and again.
> >
> > Is there a cleverer option I can add to rsync so that it only copies new
> > files, overwrites older versions of the same and only deletes any files
> > or directories that have been deleted from the source directory?
>
> Arg, typo in previous post. I meant what filesystem is on the USB stick?

FAT32

Disk /dev/sdb: 8019 MB, 8019509248 bytes
20 heads, 16 sectors/track, 48947 cylinders
Units = cylinders of 320 * 512 = 163840 bytes
Disk identifier: 0xc3072e18

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 48948 7831512 c W95 FAT32 (LBA)
--
Regards,
Mick
 
Old 05-29-2010, 09:49 AM
Peter Ruskin
 
Default rsync to a USB stick

On Saturday 29 May 2010 10:01:39 Mick wrote:
> Hi All,
>
> I run:
>
> rsync -a -l --delete -v /mnt/Business_dir /media/sdf1
>
> to back up a directory from a PC to a USB stick. However, from a
> cursory look this *seems* to copy the complete directory (every
> time I run it) and overwrites the USB stick. Carrying on like
> this it will life-expire the USB stick in no time, plus it takes
> ages to complete as it copies over every single file again and
> again.
>
> Is there a cleverer option I can add to rsync so that it only
> copies new files, overwrites older versions of the same and only
> deletes any files or directories that have been deleted from the
> source directory?

Try adding a stroke after the directories:
rsync -a -l --delete -v /mnt/Business_dir/ /media/sdf1/

Does that help?
--
Peter
================================================== ======================
Gentoo Linux: Portage 2.2_rc67 kernel-2.6.34-gentoo
AMD Phenom(tm) 9950 Quad-Core Processor gcc(Gentoo: 4.4.3-r2)
KDE: 3.5.10 Qt: 3.3.8b
================================================== ======================
 
Old 05-29-2010, 10:34 AM
Remy Blank
 
Default rsync to a USB stick

Mick wrote:
> Is there a cleverer option I can add to rsync so that it only copies new
> files, overwrites older versions of the same and only deletes any files or
> directories that have been deleted from the source directory?

See the --modify-window option in the rsync man page. In particular, the
resolution of timestamps on FAT is 2 seconds, so you may want to use
--modify-window=1.

-- Remy
 
Old 05-29-2010, 11:42 AM
Mick
 
Default rsync to a USB stick

On Saturday 29 May 2010 11:34:25 Remy Blank wrote:
> Mick wrote:
> > Is there a cleverer option I can add to rsync so that it only copies new
> > files, overwrites older versions of the same and only deletes any files
> > or directories that have been deleted from the source directory?
>
> See the --modify-window option in the rsync man page. In particular, the
> resolution of timestamps on FAT is 2 seconds, so you may want to use
> --modify-window=1.

Nice one! Will try this next time and see if it makes a difference.
--
Regards,
Mick
 
Old 05-29-2010, 11:59 AM
David Relson
 
Default rsync to a USB stick

On Sat, 29 May 2010 10:01:39 +0100
Mick wrote:

> Hi All,
>
> I run:
>
> rsync -a -l --delete -v /mnt/Business_dir /media/sdf1
>
> to back up a directory from a PC to a USB stick. However, from a
> cursory look this *seems* to copy the complete directory (every time
> I run it) and overwrites the USB stick. Carrying on like this it
> will life-expire the USB stick in no time, plus it takes ages to
> complete as it copies over every single file again and again.
>
> Is there a cleverer option I can add to rsync so that it only copies
> new files, overwrites older versions of the same and only deletes any
> files or directories that have been deleted from the source directory?
> --
> Regards,
> Mick


For years I've used "rsync -Cavzu ..." to do updates. That's been my
mantra for so long I don't recall what each option does do know that it
updates (rather than copies everything).

Indeed flash drives _do_ have a lifetime. My recollection is that it's
in the thousands of writes if not the hundreds of thousands of writes.
Assuming a life of 1,000 writes and you backup once daily, that's 3
years of backups. 10,000 writes would be 30 years. Of course if you
backup every hour, 10,000 writes is a year (or so).

Honestly, I've stopped worrying about manual copies to flash drives.

Of course if you have a program that writes to a flash drive
frequently, that's a very different story ...

HTH,

David
 

Thread Tools




All times are GMT. The time now is 06:15 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org