I have a bash file which runs a process on a series of newly downloaded files, every day, the total run time for all the processing is several hours.
I want to run a particular bash command 24 hours after a process has been run on a particular file.
I had tried to use at
for this, however I don't think you can use at to run a bash command i.e.:
at now +24 hours gsutil rm gs://$google_cloud_storage_location/$processed_file
And I also can't get it to run a bash script with arguments.
at now +24 hours -f example_script.bash $google_cloud_storage_location/$processed_file
What is the correct way to go about scheduling these tasks? Do I just need a completely different tool or am I missing a way with at
?
Example bash script:
for file in list_of_files; do
#do some processing
....
#then delete the file
at now +24 hours gsutil rm gs://file
done
at now +24 hours /usr/local/bin/doit
, and begin/usr/local/bin/doit
with#!/bin/bash
, followed by what you want?at
via stdin - either something likeecho "command <args>" | at now +24 hours
, or by using a heredocat now +24 hours << EOD; command <args>; EOD