bash - Writing a Cron Job That Can Access User Data -
I am trying to write a cron job which runs a report, and emails as a result of my user's defined address The ~ /.bashrc file was working on Fedora completely, but when I went to Ubuntu, my solution does not work anymore. Currently my order is a run order:
/home/myuser/.bashrc; / Home / myuser / bin / runreport
If I run that command manually, or it started through the gnome-schedule, it works perfectly, but It seems to run anytime. Is there something specific for Ubuntu that will block it from running?
Output of Crontab-L:
0 8 * * *. /home/myuser/.bashrc; / Home / myuser / bin / runreport # JOB_ID_1
grep -i output of cron / var / log / syslog:
4 Aug 08:00: 00 localhost cron [23234]: (Mysore) CMD (./home/myuser/.bashrc; / home / myuser / bin / runreport # JOB_ID_1)
If / home / myuser / bin / runreport
is a script, add the following two lines to the top:
Change the env set -x
and crontab
lines as follows:
. /home/myuser/.bashrc; / Home / myuser / bin / runreport & gt; / Tmp / qq 2 & gt; & Amp; 1
Then, when it runs, you must have all environment variables, and in the / tmp / qq
file that was run,
If this is not a
Comments
Post a Comment