Checking of the existence of a remote file

Otto Wyss otto.wyss at bluewin.ch
Tue Apr 9 14:06:01 EST 2002


In a Perl script I download files with rsync. But when a none existent file from
the remote server is requested, rsync prints error messages if not -q is used.
So I'd rather like to check the existence first (quiet) and then download it
(verbose). Is it possible to check with the following command:

   system ("rsync -nq $file");
   if (($? >> 8) == 0) {system ("rsync -aPv $file ...")};

O. Wyss

-- 
Author of "Debian partial mirror synch script"
("http://dpartialmirror.sourceforge.net/")




More information about the rsync mailing list