0

I have the following line in my crontab

*/1 * * * * /usr/bin/screen -S lftp /bin/bash /media/c419d280-9833-4432-b5a5-520f040b87ec/NASDataDisk1/Other/autolftp-sftp.sh >> /media/c419d280-9833-4432-b5a5-520f040b87ec/NASDataDisk1/Other/sync_cron$

But for some reason I cannot get this to properly execute. My output file, sync_cron.log, reads 'Must be connected to a terminal.'

If I use the command

screen -S lftp bash autolftp-sftp.sh 

it does execute correctly, so wouldn't the cronjob be doing essentially the same thing? But why is it not running?

1 Answer 1

0

I believe the issue is with the latter part of the script when you are writing stdout to the file. It somehow kills the seesion i believe.

Can you try with parameters -d -m to screen.

1
  • 1
    Awesome, adding the -dmS parameters to screen appears to have fixed it. Thank you so much for your quick and useful answer.
    – deadman36g
    Jul 3, 2015 at 15:50

You must log in to answer this question.

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