Quantcast
Channel: Active questions tagged amazon-ec2 - Stack Overflow
Viewing all articles
Browse latest Browse all 29245

s3 download not working from crontab script

$
0
0

I've posted about this question before, and I thought I had it solved, but unfortunately I still can't figure out what's going on.

In a nutshell: I have one JSON file in an s3 bucket which is updated daily. My crontab script (set to run once daily) downloads the file from my s3 bucket to my local directory, overwriting the existing file on my local directory. The script is run locally, on Mac terminal. The intention is to run the script once a day so that the file is constantly overwritten and updated.

I have verified that the JSON file in the s3 bucket is being continually updated, so I don't think that's the problem.

Here's the command, on crontab:

03 23 * * * /Library/Frameworks/Python.framework/Versions/3.7/bin/aws s3 cp s3://sfbucket.bucket/sf_events.json /Users/Documents/TownSounds_Javascript/data/sf_events.json >> /Users/Documents/logs3.txt 2>&1

The above crontab script is failing to run. The only way I can get it to run is by editing the crontab script once, manually: * * * * *

Whereupon it runs one time, and then reverts to not running at all.

When I check the logs3.txt, the date modified does not appear to be updating, which is also an indication of it's failure to run.

I've further investigated, and created a test crontab script:

* * * * * echo `date` >> /Users/Documents/testCrontab.txt

And it works fine, outputting exactly as expected.

Can anyone tell me why the crontab script for the s3 file may be failing to run? Do I need to be logged in to s3 for the script to be able to do it's thing and pull the file? Amazon s3 automatically logs me out after a period of inactivity, so this seems infeasible.

I've read that aws s3 sync might be what I'm looking for?

Any help would be much, much appreciated as I've been banging my head against the wall about this for some time now!

Thanks.


Viewing all articles
Browse latest Browse all 29245

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>