Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Page 2 of 2 < 1 2
Topic Options
#70551 - 14/02/2002 12:25 Re: I take it back, all is not well, please see [Re: tms13]
mtempsch
pooh-bah

Registered: 02/06/2000
Posts: 1996
Loc: Gothenburg, Sweden
I just can't bend my brain to understand how the -f and -u flags are supposed work
together...

-f says to always remove existing target file in favor of source file
-u says only copy if source is newer than an existing target

anyone that can enlighten me?

After playing with cp for a while it seems that (at least on Debian x86 Linux) -u
beats -f, and if target file, newer than source file, exists, no copy is performed, no
matter in what order the flags are given.

For a freshly created disk (from factory or after applying the builder .upgrade)
which the FAQ procedure uses, neither -f nor -u should be necessary, as there are
no existing fid files in the target that we need to clobber or preserve. If you're
playing around having mounted a partition under /drive0 on the source drive you
probably also know enough to append 'x' on your own...

The /drive0/ instead of /drive0 is a good precaution, though if /drive0 is missing you
have something seriously wrong and will probably need to reapply a .upgrade file
anyway...

Tony, generally flags in Unix can be given separately, like '-f -a -q', or in one go
(some exceptions exist) like '-faq'

Considering the fact that the FAQ presumes a fresh drive, I'd say

cp -av /drive1/fids /drive0/ (Enter)

for the FAQ, with a small note that if you already have partially copied the fids,
change '-av' to '-avuf'. Or just point to this thread

Edit:

Bah, also given the fact that the FAQ presumes a fresh target - adding the -u
and -f flags will do no harm, and might be useful on other occasions - I'll change my vote to

cp -avuf /drive1/fids /drive0/ (Enter)

/Michael

_________________________
/Michael

Top
#70552 - 14/02/2002 12:34 Re: I take it back, all is not well, please see [Re: mtempsch]
SE_Sport_Driver
carpal tunnel

Registered: 05/01/2001
Posts: 4903
Loc: Detroit, MI USA
But you've still got f AND u?
_________________________
Brad B.

Top
#70553 - 14/02/2002 12:38 Re: I take it back, all is not well, please see [Re: SE_Sport_Driver]
mtempsch
pooh-bah

Registered: 02/06/2000
Posts: 1996
Loc: Gothenburg, Sweden
Duh, yeah... as -u always seems to override -f , -f could be removed...

Another try

cp -avu /drive1/fids /drive0/ (Enter)

/Michael
_________________________
/Michael

Top
#70554 - 14/02/2002 13:13 Re: I take it back, all is not well, please see [Re: mtempsch]
tms13
old hand

Registered: 30/07/2001
Posts: 1115
Loc: Lochcarron and Edinburgh
-u and -f together mean that the file will be copied if
  • there is no existing file in the destination directory, or
  • the existing file in the destination directory is older than the source file
but not if
  • there is an existing file in the destination directory that's newer or the same age


Without the -f, the mere presence of the file in the destination directory will prevent the copy (and give an error message IIRC). Without the -u, any file may be overwritten, regardless of its timestamp.

The safest thing is to use -f and not -u - then even if a file has a corrupt timestamp or has been half-copied, it should still get overwritten. This is of course the slowest version, though.

If you're starting with a fresh, empty destination directory, neither of these flags makes any difference, anyway.
_________________________
Toby Speight
030103016 (80GB Mk2a, blue)
030102806 (0GB Mk2a, blue)

Top
Page 2 of 2 < 1 2