1

I am trying to run boto-rsync using script.sh:

#!/bin/bash
echo `date`
echo "start"
boto-rsync -d 2 -a <access key> -s <secure key>  s3://db-dump/hourly/2013/ /mnt/dir
echo "stop"

It works perfectly fine. But when I run this using crontab, it ignores boto-rsync line.

Can anybody help?

Ivan Ferić
  • 4,725
  • 11
  • 37
  • 47
Karm
  • 19
  • 4

2 Answers2

1

Nine times out of ten, when you have a problem where something runs fine until you put it into a cron script, the underlying issue is that the cron script is running as a different user (root, usually) and the environment is not set up to access the command in question. So try doing a "su" and then typing "boto-rsync" and see if it's able to find the command.

garnaat
  • 44,310
  • 7
  • 123
  • 103
1

I got the solution for this. We need to add python and location of file

#!/bin/bash
echo `date`
echo "start"
python <location of boto-rsync> -d 2 -a <access key> -s <secure key>  s3://db-   dump/hourly/2013/ /mnt/dir
echo "stop"
Karm
  • 19
  • 4