Extending fcopy
Janning Vygen
vygen at planwerk6.de
Fri Dec 8 17:19:44 CET 2006
Am Freitag, 8. Dezember 2006 16:48 schrieben Sie:
> > > > - some -k/--keep option (which I'd rather call --keep-permissions :-)
> [...]
> If a file permission get borked it will never be fixed by an softupdate.
you don't need to use the -k (keep-permissions) option, so spftupdate can fix
it. But why should it be broken anyway?
> In the case that it's not root:root 644 it has in most cases a special
> reason. If the file is missing there noting to preserve, what to use then?
then use -M, -m or source file permissions as it is right now.
> [...]
> > i tried to use exit code, too:
> [...]
> > > this way you can say
> >
> > fcopy ... /etc/postgresql && /etc/init.d/postgresql restart || exit 1;
> >
> > What do you think about using exit codes? First i sort it's not unix
> > like, but diff does like this, too.
>
> Add $? to your prompt and you'll see that much more apps do it like this ;)
> So both methods can coexists with file list turned on (or off) with a file
> an option.
i switched this behaviour now after some tests. My patched fcopy now returns 0
if no files were changed or 1 if files were changed. I changed because if
fcopy returns exit code 1 when nothing was changed it was propagated as the
script exit code. But i am still not sure what is nicer, to return exit code
1 if files were changed or return exit code 1 if files were NOT changed.
kind regards
janning
More information about the linux-fai-devel
mailing list