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.
First you have to check if the cron daemon is running and if you as a user are allowed to run cron jobs, but don't worry too much, since Linux enables that by default (just check if something doesn't work). To write your own crontab you will issue the command
it will open a vi session in which you can write your own cron jobs. Then save and quit and the system will store the proper file in the proper location automatically. Check man crontab for other options of the crontab command (for example to display or to remove the current crontab).
For the format of a crontab line, that is how to specify a cron job see
man 5 crontab
it describes the crontab format and gives some useful examples. If you're in trouble feel free to ask.
I have created a script to take backup. when i run this script using the browser it will work fine and create tar.gz files but when i try to run this using the command line in Linux it will display a error:
tar: Removing leading `/' from member names
now what to do to solve this problem.
my script code is below
###### script code start here #############
When you are executing a script from cron, you should be careful to expand all paths in your script. You might be running the script from a location where you have all the files needed and the script might execute just fine from the command line. But when you put it in the cron file , it will fail. This is a common mistake we do.
To run a cronjob every 15 minutes another way would be :