I am trying to write a cron that will run sacct command of slurm for given dates and save it in file. As I don't have much experience with shell script I am not sure how to do it.
I did the following: I created a shell script with the following code (sacct_data.sh):
#!/bin/bash
startdate=`date +"%Y-%m-%dT00:00:00"`
enddate=`date -d "yesterday" '+%Y-%m-%dT00:00:00'`
TZ=UTC sacct info_that_needs_to_be_pulled --starttime $startdate --endtime $enddate > data.log
In the crontab I have the following code:
* * * * * bash sacct_data.sh #I know this will run every min, but that's is not important
However, I am getting the error "sacct: command not found".
Any help is appreciated :)