fcopy feature request: report if a file was copied

Janning Vygen vygen at planwerk6.de
Wed Dec 6 16:05:10 CET 2006


Am Mittwoch, 6. Dezember 2006 15:35 schrieb Thomas Lange:
> >>>>> On Wed, 6 Dec 2006 15:23:58 +0100, Janning Vygen <vygen at planwerk6.de>
> >>>>> said:
> >>>>>
>     > if [ `fcopy -iM /etc/ntp.conf` -gt "0" ]
>     >
>     > it would be nice to have an option like
>     >  -n --number  report number of files changed
>     > and let fcopy report the number of files changed
>
> Good idea. 

thanks.

> But then fcopy must not write any error or verbose messages 
> when using -n. Or should -n report the number of files changes using
> the exit/return code?

we have two options:

- using error code:
i thought about using return code first, but isn't it a little bit 
non-unix-stlye to use exit code for reporting?

- using stdout:
we could print verbose messages to stderr with "warn" and use stdout only for 
reporting number of files. 

i think using stdout is best, just reporting a number.
The script could even build a nice report with "-R full" to send to 
administrator showing diffs and chmod/chown/utime

if you get output with -R something was changed, so you can always reload the 
daemon.

so my proposal would be:

1. send all verbose output to stderr 
2. create a new option

  --report [number|filenames|full|mail]
    "number" (default if -R is given): reports number of file
     changes to stdout
    "filenames" list all files which has changed one per line
    "full" list all files and their differences of content or modes
    "mail" sends full report to stdout and root at localhost

But i am unsure how to name the option as "-r" is already used, as -l --list 
and -c --count are used, too.

kind regards
Janning



More information about the linux-fai mailing list