s3cmd run on command line not on cron

Posted by Jonar on Server Fault See other posts from Server Fault or by Jonar
Published on 2010-12-03T15:25:37Z Indexed on 2011/01/09 11:55 UTC
Read the original article Hit count: 240

Filed under:
|
|
|

Many have said that the problem is with environment but I still can't seem to solve this problem. BTW I am using Ubuntu 9.10 login as user, then sudo -s using this command: s3cmd put file s3://bucket >>worked! now here is the simple script intended for testing:

#! /bin/bash
env >/tmp/cronjob.log

s3cmd put file s3://bucket

issuing the command crontab -e

* * * * * /opt/script  2>&1 | logger

Then using tail to syslogs

Dec 3 23:22:01 ubuntu CRON[10795]: (root) CMD (/opt/script 2>&1 | logger)

But by verifying it on s3Fox Organizer, the file is not uploaded.

(I tried changing the #! /bin/sh (no effect), putting crons on /etc/crontab (no effect), setting HOME=/home/user (no effect)

What are other options to try? Or other ways to debug this problem.

Thanks

© Server Fault or respective owner

Related posts about cron

Related posts about crontab