Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
I am trying to schedule this backup job using CRON. The test I tried before in which I just scheduled an email to be sent worked fine. But no such luck here.
Here is what I did:
1) I created a file called backup.sh in the /etc/cron.daily folder, which had this as its contents:
tar -czvf /backupdirectory/backup.tgz /directorytobackup
2) I installed this cron job in crontab:
12,32 * * * * /etc/cron.daily/backup.sh
Am I placing the backup.sh file in the wrong directory? Also, do I need to create an .sh file at all? Can't I just put the backup command right in the cron job instead of calling to the backup.sh file?
The syntax you gave tells it to execute at 3:25 PM every day. So it should've executed today. For sanity's sake make sure crond is running and chack your cron log in case there were errors (it should be in /var/log/cron). Also, you might want to provide the full path to tar just to be safe.
I didn't understand what you meaned by "I scheduled and installed". By the manual, all you have to do is enter "crontab -e" as the user owner of that queue. crontab will open your preferred editor for you to edit the job. When you save the edit and close the editor, it does a consistency test of the jobs and submit to the cron queue. You can see the scheduled jobs with "crontab -l".
Oddly, the backup actually ran - precisely an hour after I scheduled it. It was scheduled for 4:35 in the Cron Job and ran at 5:35 instead. To test this, I just scheduled a job for 7:30 in crontab and it ran at 8:30.