Cron related Info

Crontab

Script to run

#!/bin/bash
#script1.sh
tmpFile=$(mktemp)
date=$(date +"%Y-%m-%d")

/cm/shared/apps/bioinf/R/3.5.1/bin/Rscript /path/to/script.R >>$tmpFile

if [ $? == 0 ];then
	echo "Script succeeded" >> $tmpFile
	f1="/path/to/output.pdf"

	mail -s "Feedback script1 $date" -a $f1  me@email.com < $tmpFile 
else
	echo "Script failed" >> $tmpFile
	mail -s "Feedback script1 $date"  me@email.com < $tmpFile 
fi

# Use specific separator for awk columns
# Minute Hour Day Month DayOfTheWeek

# Two times every hour during office hours
10,30 8-16 * * * /home/me/script1.sh >/dev/null 2>&1

#every first of the month  at 7 o clock
0 7 1 * * /home/me/script2.sh >/dev/null 2>&1