ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
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.
The nake of the file doesn't matter nor does the location.
I would create a directory called "cron" in the home dir of the user it will be run as:
In that put:
I put all my scripts in the jobs directory and output the logs to the logs directory (same name as the job with a .log extension)
In the /root/cron dir I create my cron files. If there is only one server it is usually "cron.standard" if it is a 2 system failover "cron.master" and "cron.slave". To load a crontab file (eg cron.standard) run:
You cna check that it has loaded using:
I have only dealt with CRON on Solaris, but I ran into lots of problems with extra spaces and newlines in my cronfile. Be careful about them, seems that cron is sensitive to them. Especially newlines after your line
Ok, so, I have this cron file. I call it cron.mine (?) and put it in cron/jobs. It says:
0 10 * * /root/cron/jobs mail -s pengun "It's 10 o'clock" root
to let it email me whenever it's 10 o'clock. (tell me if i'm right.)
oh, and would it email to user penguin or user root?
sadly, I just killed(ish) my linux drive... must reformat
NEVER delete things as root unless it's one thing and you must read it carefully, never just say y y y y y y to "do you wanna delete this?" because bad things happen..