Results 1 to 4 of 4
Good Morning,
I am new to Linux and so still have a lot to learn ...
I have a file called crontab in /etc/crontab, and I can edit it using
...
- 09-28-2008 #1Just Joined!
- Join Date
- Sep 2008
- Posts
- 13
crontab problems
Good Morning,
I am new to Linux and so still have a lot to learn ...
I have a file called crontab in /etc/crontab, and I can edit it using
vi /etc/crontab.
I have an entry, as follows ...
0/1 * * * * ~/public_html/swordfish/call_centre/cron/auto_report_fred.sh
BUT cron does NOT run it. Why not ?
Another problem is when I use the crontab command 'crontab -e' to edit the crontab file, it creates a new one and does not see my manual changes.
I have also tried create a crontab file like this 'crontab <filename>'
but that reports the following error ....
"no crontab for root - using an empty one"
How do I use crontab correctly ??
regards,
Steven M
- 09-28-2008 #2Linux Guru
- Join Date
- Nov 2007
- Posts
- 1,695
You can find tons of cron info via Google => Example
Edit cron for the current user you are logged in as:
Edit cron for another user (only root can do this):Code:crontab -e
A ~ means the home folder of whatever user the crontab is running under. So if the crontab's user is roger, then it's looking for /home/roger (assuming default home dir.)Code:crontab -u <user> -e
Root's home is /root usually (on Linux.)
To view crontab's, use the list switch:
Code:crontab -l
- 09-30-2008 #3Just Joined!
- Join Date
- Aug 2007
- Posts
- 25
crontab usually goes under /var/spool/cron/tab/user_name may vary by linux flavor.
Where ever it is it should never be directly edited, Only use crontab -e to edit the entry.
- 09-30-2008 #4
Crontab
You might want to do a backup of the original crontab file before using crontab -e
Creating a copy
To restore use the followingCode:crontab -l > /root/crontab.orig.<date>
Code:crontab /root/crontab.orig.<date>


Reply With Quote