-1

I have a ssh script (for testing purpose) that I can run successfully from cmd:

#!/bin/bash

/usr/bin/sshpass -p 'password' /usr/bin/sftp user@host:/out/test/ <<< $'put -r /data/test/*'

A ./script.sh runs absolutely fine and uploads all files to remote.

But when I call script.sh from crontab, nothing happens. Why?

1 Answer 1

0

I could get it working as follows:

/usr/bin/lftp sftp://user:pass@host -e "set sftp:auto-confirm yes; 
    set net:timeout 10; set net:max-retries 3; mirror -R --max-errors=1 --verbose=1 
   /local/test /remote/test; quit;"

This syncs all files inside /local/test/ to the remote sftp folder.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .