Slackware :: How To Create Cron Job To Execute At Same Time Each Day
Nov 11, 2010
I was thinking of creating a little audio alarm clock with an mp3 and mpg123 to play a song from a cron job each day. How do you specify the time of day to execute a cron job?
I cannot debug or resolve on a Fedora Core 8 machine. The problem exists in a Fedora 11 machine as well. I have a script that changes the default gw (I have 2 providers) if the link is down. The script runs very well when I call it from the terminal, however when I try to set a cron job to run it, it hangs in the middle of the script. I don't have any idea of what is happening, or how to debug but it seems to hang when running a command like: route add default gw [ip]
I can publish the script here, but it's fair an simple and the algorithm is: - start - Find out the current GW - Find out the alternative GW - Ping the current GW and capture the result - if we have a fail then change the default gw to the alternative Gw and send an email, else do nothing - end
The cron job is run as root, so I don't think this is a rights problem.
I've written a script that restarts the server of a game I play, giving you a 15 second notice. If I manually start this script, it works fine. invalid option say Server is restarting in 15 seconds-ne and it says this for every line in the rest of the script (substituting the correct phrases of course, but always starting at the "say" and ending with the "-ne")
I've read a lot on how to setup a task in crontab. I think I understand how to edit the file, but when I try to save the changes, it says "no crontab for xxx." Then it says that it cannot create a new crontab. I have ubuntu desktop 9 running as a webserver. I've read the details in these posts and it isn't helping.
I have a script to record a weekly radio show from a Sydney radio station.I am in Brisbane.Sydney and Brisbane are both in the same time zone but Sydney(NSW) bounces around on daylight savings time and Brisbane(QLD) does not. Is there a way to specify a timezone for a specific job in the crontab file? If so what would be the format for Sydney so it follows the daylight savings time changes? Right now I will just change the cron schedule when Sydney goes on and off DST.
I'm doing a program and I want it to execute some code during n seconds. For example e put a command in the shell like this 'ls % 10' and the program should run the command ls for 10 seconds.I'm trying something like this:
I have cron jobs running and the timing is critical, because I'm running Nessus scans on production servers. If I hit them at the wrong time, I'm toast. But when I check the cron log, I see that it is an hour off. Here is the output for the command "clock": Wed 31 Mar 2010 03:01:26 PM CDT -0.257677 seconds
And this is the tail of the cron log: Mar 31 16:00:01 nes-001 CROND[8790]: (root) CMD (/Nessus/Targets/NessusScriptDataCenterScan.test) Mar 31 16:01:02 nes-001 CROND[8822]: (root) CMD (run-parts /etc/cron.hourly) Mar 31 16:01:02 nes-001 run-parts(/etc/cron.hourly)[8822]: starting 0anacron Mar 31 16:01:02 nes-001 anacron[8832]: Anacron started on 2010-03-31 Mar 31 16:01:02 nes-001 anacron[8832]: Normal exit (0 jobs run) Mar 31 16:01:02 nes-001 run-parts(/etc/cron.hourly)[8834]: finished 0anacron
Cron thinks it is 4:00 p.m., but it's really 3:00 p.m. How do I tell Cron what time it is? (Stopping and restarting the crond service did not change it.)
Within a VMWare ESX virtual machine, I am running CentOS 5.2. (Actually, it is kind of a virtual appliance to run CollabNet's Teamforge - which I have installed for a trial). I've been dabling with Linux for a year or so, but I know I have much to learn.
I'm attempting to run a cron job that runs a backup script at 11pm. It works great, but unfortunately it runs at 11:30 am.
I created the cron job using 'crontab -e', while logged in as root. My cron job line is : 0 23 * * 1,2,3,4,5 /etc/tjt_backup/collabnet_backup.sh
If I type 'date', I get the correct date/time in my timezone: Tue Mar 9 16:27:12 CST 2010
If I type 'clock', I also get the correct date/time: Tue 09 Mar 2010 04:26:57 PM CST -0.463330 seconds
I am running Centos 5.3. I ran no updates, performed no installs, nor changed any configuration immediately prior to this issue. My problem is this: when I run the command startx (default runlevel 3), it is a long time (5-10 minutes) before Gnome startx, and once it does start applications will not run. Also, when I try to use sudo (from any environment, even ssh), it is a long time (5-10) before the command is executed.
I cannot say for sure, but it seems like this is an intermittent problem. Sometimes X takes a long time to start, but once it starts it will launch programs. Sometimes X takes a long time to launch, but once it starts it will only launch certain programs. Though presently X always takes a long time to start, and I cannot successfully launch any programs.
A while back a had a similar problem to this (x taking long time to start, sudo taking long time to execute) and it ended up being a DNS problem. Unfortunately, I cannot remember exactly what it was and I stupidly did not document it. Maybe this is also DNS related, I don't know.
I don't know what log files to look at for problems with X, Gnome, and sudo taking a long time to start.
way to hibernate at a specific time or after a some minutes (like 40 minutes to an hour, guess the exact time doesnt matter anyway). normally i shutdown my comp at night with
Code: sudo shutdown - P HH:MM
which works just fine, but sometimes i have like 4 workspaces of stuff open that i'm working on so i'd rather just hibernate. shutdown -H does this halt thing that is really not my cup of tea so from the aformentioned googling i found out about at and sleep and crontab etc. but at and sleep cant recieve my sudo password beforehand so its useless and crontab is for repetitive scheduling, which i'd like to avoid cause i would hate to be working and suddenly have my forgotten crontab script hibernate me.
so is there any way to do a delayed hibernation? or at least some way to provide the sudo password to an at or sleep prefixed command, beforehand?
i'm only interested in doing it straight up through the terminal, not through other 3rd party software cause i tried a few of those before i found out about shutdown and they didnt work very well.
I use two monitors,my problem is that I want to change the setup,so that the other monitor becomes default.There's no problem with my BIOS settings and I have tried every GUI tool that could help me(to my knowledge).Well I've found this URL...that helps a lot but I want to execute the command every time I boot before the splash screen(so that the login screen appears on the right monitor).I've tried rc.local but had no success.Any ideas on how to execute the command at boot time?
I wanted to use cron to play a media file at a certain time (i.e. use it as an alarm clock). However it seems to do nothing. The contents of my crontab is:
How do i log the start/completion (time&date) of my cron job script? i want to be able to see what time it started and what time it finished? and if there where any errors while running my script.
answer this question?How to create a cron file that will regularly perform the following backups:a. Performs a level 0 backup once per monthb.Performs a level 2 dump one day per weekc.Performs a level 5 dump every day that neither a level 0 nor a level 2 dump is performed. If not, I'm I close? This is homework, so I don't want a direct answer
Somehow Bind dns, Postfix, Cron all fail to start automatically at boot time? All of them need to be started manually after the system is up in order to function.
This is Kishore and i am new to Ubuntu and SVN and please some one help me in creating a cron job for my svn backup every day at 10:30 pm I already created a cron job which looks like 30 10 * * * svnadmin dump /home/administrator/svnrepository >svn1 when i run command directly i am getting whole backup and it's size is 3.6 gb but when i run through cron job the backup size is only 9 mb. So finally my requests are 1. cron job for taking complete svn backup at 10:30 pm daily and 2. cron job to copy the SVN backup in to my windows system in d drive and this must be run every day at 11:30 pm.
I have a linux (Slackware) machine and the time/date is like, June 23rd 2003, 10:00am (It's 11 here) and I am not able to set the time to have it correct. I change the timezome to Montreal but the time is still wrong.
Is there a way to force it to sync with my domain controler or even another online NTP server?