Setting up crontab SUSE Linux 8.2
Here is my delima: I am a newbie to Linux and I have racked my brain trying to setup a simple cron job to perform a backup on my machine. My administrative doc states that /etc/c rontab cannot be processed with crontab -e. When I attempt to do this my editor opens, I include the following line:
5 1 * * * /usr/bin/scripts/run-backup I am then asked to save the crontab with a name of crontab.xxxxx and they are stored in the /tmp directory. Why is the temp file being generated? I then tried to modify the root user in /var/spool/cron/tabs to include this line: 5 1 * * * root /usr/bin/scripts/run-backup This failed to work as well I then tried to create a crontab file from the root profile and store it in /etc/cron.daily Another failure Can anyone offer me any step by step assistance? I have review admin doc for SUSE and other sites via Google and cannot find anything definitive to my OS. |
For cron jobs I usually just do the following:
edit a file with filename of your choice (ex: vim cronjobs) Enter in your cron info, for example to backup my /home/<username> directory I do 30 13 * * * tar -cvf /backup/daybackup.tar /home/<username>/* Then as root I would do # crontab cronjobs This may not be what you are looking for, let me know if it isn't |
I know you are not supposed to change '/etc/crontab' this way, but I 'su' as root then edit the crontab file.
You will also need to make sure the script '/usr/bin/scripts/run-backup' works as required manually. Then it should work. Most put all cron jobs in '/etc/cron./*', then leave the crontab file alone. So that the cron job will use crontab to run anything in '/etc/cron.*/' JN |
Thanks for the feedback. I will attempt follow your recommendations and give you an update soon.
|
if you are new, I would also suggest trying webmin (www.webmin.com). you may already have it installed on your system as it is included in many distros. to launch webmin, enter https://localhost:10000 in your favorite browser. Its cron scheduling agent is really easy to use.
T |
Attempted to install webmin package via YAST2. Package was installed succesfully.
When I attempted to start the service here is message I recieved: Start: /etc/init.d/webmin start returned 127 (Unspecified error.) Stop: /etc/init.d/webmin stop returned 127 (Unspecified error.) /etc/init.d/webmin: line 30: /etc/webmin/stop: No such file or directory Refresh: /etc/init.d/webmin status returned 1 (Program is dead and /var/run pid file exists.) grep: /etc/webmin/miniserv.conf: No such file or directory Webmin is stopped /etc/init.d/webmin: line 30: /etc/webmin/stop: No such file or directory I am not sure where to proceed as a result. |
Quote:
Next I will try to put my backup script in the etc/cron.daily/ and see if it get's run automatically. |
All times are GMT -5. The time now is 12:42 PM. |