A question on cron
I'm logged in as root and I edited crontab with
Code:
crontab -e Code:
25 13 24 9 4 * root /usr/bin/echo "sick" > /home/trist007/itworked.txt What am I doing wrong? |
cron is likely interpreting these as separate things.
You need to so something like "/usr/bin/echo sick" > /home/trist007/itworked.txt |
Did you try
Code:
/usr/bin/echo "sick" > /home/trist007/itworked.txt I also remember you had to do a redirection, i think Code:
/usr/bin/echo "sick" > /home/trist007/itworked.txt 2>&1 |
I understand that the >&1 redirects the output to that variable, but what is the 2 for?
|
Quote:
|
Got it to work with
Code:
52 13 24 9 4 /usr/bin/echo sick > /home/trist007/itworked.txt 2> /dev/null Also, what if i wanted a certain user to execute that would it have been? Code:
52 13 24 9 4 root /usr/bin/echo sick > /home/trist007/itworked.txt 2> /dev/null |
2 is the file descriptor for STDERR, and using it in your crontab means that any errors will go to /dev/null.
If you want a certain user to execute a cronjob, you should create a crontab for that user |
All times are GMT -5. The time now is 09:55 PM. |