AnswerBun.com

S3 command not working in cron

I have this ultra simple cron job:

48 20 * * * cd /home/pankaj;s3cmd -f get s3://myfile.gz

The command works by itself. But the cron job does not. The cron job
is created for the same user(pankaj) who is able to run the command.
There is not much information in /var/log/syslog either.

Oct 15 20:48:01 dev CRON[17020]: (pankaj) CMD (cd /home/pankaj;s3cmd -f get s3://myfile.gz)
Oct 15 20:48:01 dev CRON[17019]: (CRON) info (No MTA installed, discarding output)

How can I find out what is going wrong?
The permissions of .s3cfg are like these:

[email protected]:~$ ls -l .s3cfg 
-rw------- 1 pankaj pankaj 2050 Feb  7  2018 .s3cfg

Super User Asked by kargirwar on December 31, 2020

1 Answers

One Answer

Modified the cronjob to this:

48 20 * * * cd /home/pankaj;s3cmd -f get s3://myfile.gz 2>&1 | tee log

And log showed this:

s3cmd: command not found

:(. So a simple change solved the problem:

48 20 * * * cd /home/pankaj;/usr/local/bin/s3cmd -f get s3://myfile.gz

Answered by kargirwar on December 31, 2020

Add your own answers!

Related Questions

Ampps rejects my Mac user password when I open it

1  Asked on December 18, 2021 by moaz-mabrok

       

Blktrace missing I/O events

1  Asked on December 18, 2021

   

Filling Out a Matrix for Excel Using Survey Data

1  Asked on December 18, 2021 by spidercrawler

   

Where is OS X saving launchctl changes

1  Asked on December 18, 2021 by mutti

     

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved.