s3cmd works on command line not on cron

Ubuntu 9.10 is my linux distro
Based on forums they say that the problem is with environment .

here is my case:
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

This question is so common that it's in the FAQ here. things run by cron have a different, very minimal PATH than things run in the shell and may not find things under /usr/bin and so forth. Call s3cmd by its absolute path.