in reply to Re: Backup Script Pb
in thread Backup Script Pb

Oh yeah !!

I deleted "$chan->blocking(0);"

I added "sleep (15);" after the 2 tar commands line

There is now only 2 octets difference between file test and test2. I tried the backup file created with the script and it works.

Thanks for the help !! Once you have the answer it sounds so dump xD

Replies are listed 'Best First'.
Re^3: Backup Script Pb
by salva (Canon) on May 03, 2016 at 08:21 UTC
    Instead of sleeping for a fixed amount of time, you can use the wait_eof method.

      Can you please enlight me with this method ? I read about the eof command in perldoc site.

      I may not use it correctly but what I did is to close the ssh connexion like this:

      $chan->close() if eof;

      It works too ...