Ubuntu Servers :: 10.10 - Daily Cron Script Does Not Run
Feb 21, 2011
I'm with Ubuntu server 10.10. I created a script and put it in /etc/cron.daily. But looks it doesn't run (it didn't generate any log). The following is all I did.
Code:
root@chonseng1:/var/log# cat /etc/crontab
# /etc/crontab: system-wide crontab
# Unlike any other crontab you don't have to run the `crontab' command to install the new version when you edit this file and files in /etc/cron.d. These files also have username fields, that none of the other crontabs do.
SHELL=/bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
# m h dom mon dow user command
17 * * * * root cd / && run-parts --report /etc/cron.hourly
25 6 * * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
47 6 * * 7 root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
52 6 1 * * root test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
#
root@chonseng1:/var/log# ls -l /etc/cron.daily/ntpdate
-rwxr-xr-x 1 root root 52 2011-02-18 13:22 /etc/cron.daily/ntpdate
root@chonseng1:/var/log# cat /etc/cron.daily/ntpdate
ntpdate ntp.ubuntu.com >>/var/log/ntpdate.log 2>&1
I am running on a laptop and cron.daily is set to run at 0625 So I wonder what happens if my machine is not turned on at that time.. At that rate it could also be off for the other periods as well (weekly, monthly) Is there solution that will allow them to run once they are online after the appointed time? using a cron entry that runs every 15 or 5 or 1 minute.
I have added some executable scripts to /etc/cron.daily but don't get the stdout/stderr output from them as mail (or anywhere else I have found). At least one of them is running (because I can see that it has added a file to the disk).
The peculiar thing is that I do get the output from /etc/cron.daily/0logwatch (part of the logwatch package) as an email each day.
The MAILTO line in /etc/crontab is "MAILTO=root" (unchanged from default). Same for /etc/anacrontab.
I do have an alias at the end of /etc/aliases which redirects root's mail to my own account, but this alias works fine for mail I send manually. (It also appears to work fine for the output from the file /etc/cron.daily/0logwatch.)
since I setup my system so that I'd receive system errors via email, I get an email each day from /etc/cron.daily/apt.Just wondering why this is, how I can fix it, or if I can just remove apt from cron.daily?uote:
To: root@jon-desktop Subject: fcron <systab@jon-desktop> run-parts --report /etc/cron.daily /etc/cron.daily/apt:
I have an issue, it doesn't happen every day, I can't seem to trace it down. It happens at 4:02am the cron.daily kicks of at 4AM.. The following is from the /var/log/messages. I receive an panic error then the server shuts down.
I made a big rookie mistake in a script in cron.daily, which emptied the directory when I tested it... now I'm left with an empty cron.daily directory, and from what I know there definitely were more scripts there than only my own. Does anybody know what scripts CentOS 5.4 (Final) needs in the cron.daily?
I have noticed that in the /etc directory there are some subdirectories of /etc/cron.daily and /etc/cron.hourly. Also I have determined that there is a service included as part of the Fedora OS 'crond' which I have started with the use of 'service crond start'. My question is this. If I drop an executable file into the '/etc/cron.daily' directory will it just run? If not what configuration files should I go about editing to run my executable daily? There seems to be a pretty large network of cron related files. I'm trying to make sense out of all of it.
I have two custom tasks running daily. How do you give priority to one over the other?One of them is configured via the logrotate.conf. The other sits directly in cron.daily.I'd like the one in cron.daily to run after the script that is in logrotate.Please can you advise how to do this...
Gidday, for some reason some of my RHEL servers don't send out a daily logwatch email (most do, but two don't) - and sadly I have no idea how to troubleshoot this.
Can anybody give some help/hints as to where/how I may troubleshoot this. I should add that these servers can/do send emails (I have some cronjobs that fire off emails upon completion of their jobs, so I know its not a sendmail config issue).
I have a Dell Poweredge, 6 months old, running Fedora core 8. I have 2GB RAM and 500Gb SATA HD. I am running 3 VMWare machines. Two Win2003 Servers and 1 XP Pro. My server crashes almost daily. It doesn't actually reboot, it just freezes. It got to the point where I had to get a device that automatically reboots the server when it can't ping the server anymore. /var/log/messages has no entries that indicates the server crashed. It just stops at the point where it dies. The windows VMWare server also have no errors in the event log to indicate a problem.
Cron for root does not run,it's 8.04LTS ubuntu server,however Cron runs for other users,Can anyone help?i've checked many times that i have the right syntax.
Ubuntu server 10.04:I had webmin installed on my server, but I found it was using too many resources for what it offered, so I went ahead and uninstalled it. I'm not sure exactly which version it was, but it was the most recent version a month ago. I ran the uninstaller which ships with webmin.Well, now everyday my root account gets the following email:
From root@DOMAIN.com Mon Oct 18 00:42:01 2010 Return-Path: <root@DOMAIN.com> Date: Mon, 18 Oct 2010 00:42:01 -0400
I am running a headless Ubuntu server accessed through Webmin. The server is running 10.4.2 64 bit version. I have a number of cron jobs including a simple back-up job which is: Code: rsync -av /media/server/ /media/backup/backup/ All of the other jobs run fine but for some reason this job which is scheduled to run each day at midnight does not run. If I SSH into the server and run the job manually it works fine.
I am unable to run my cron tab job without root password.I made a little research on the forums and appearantly it should be changed.Must I change "passwd" part with my root password?
I'm trying to setup a cron with screen. the purpose of running screen is because i want to resume to see the status of the job while it is running. anyone can enlighten me how i should setup my cron. I've tested with
I am using my ubuntu server as my home router.Everything is working as expected with one exception.y DSL modem is a POS and every now and again it looses connection to the router. Sometimes it needs to be reset and sometimes it does not.Either way, when this happens my ubuntu server needs to reacquire an IP from my ISP. If it screws up when I'm at home it's no big deal, but if it happens when I'm not around my housemates have taken to hitting the reset switch on the server. I'm not a big fan of this so I wrote a script to ping my ISP's gateway. If it's unavailable it bounces the eth0 interface and tries to get an IP. I am running this script every couple of minutes in a cron job. Now I'm getting syslog entries like
Code: Aug 9 20:31:01 portal CRON[9602]: (root) CMD (/opt/ChkAndFixNetwork.sh) every few minutes. This is annoying and makes the logs useless for troubleshooting. I
Have a headless server running Lucid 64 bit. Everything is working great except for a couple of Cron jos I'm trying to have run at boot.
My user crontab looks like this: # m h dom mon dow command 01 * * * * /home/ceallred/Scripts/SambaBkup.sh @reboot /usr/bin/SpiderOak --headless &The SambaBkup script works like clockwork...
The SpiderOak job doesn't start. It works if I type the command in manually. syslog only shows:Jul 13 22:45:33 RavenWing cron[1010]: (CRON) INFO (pidfile fd = 3) Jul 13 22:45:33 RavenWing cron[1022]: (CRON) STARTUP (fork ok) Jul 13 22:45:33 RavenWing cron[1022]: (CRON) INFO (Running @reboot jobs) Jul 13 22:45:33 RavenWing CRON[1048]: (ceallred) CMD (/usr/bin/SpiderOak --headless &)Yet ps -A doesn't show a running SpiderOak process. It shows after starting manually.
Code: #!/bin/sh chown -Rc steven:users "/home/steven" I have more lines in the script but each line does the same error. This is run in a cron job but it always returns.
Code: chown: cannot access `/home/steven ': No such file or directory But it is a valid directory I have even tried adding an / and even a space on the end and still same error.
I recently set up exim so that I could test emails sent from my php sites. I have now been getting daily emails that either report errors from cron jobs or report a failure to send emails to root@cory-laptop or cory@cory-laptop about cron errors.I first of all don't want mail sent to the above addresses, because they are obviously not actual email addresses. Second, I'd really prefer not to get emails when an email failed to send to these addresses.
I'm getting the following messages sent to my root account mailbox. It appears to be reporting an issue finding ntpdate, however when running the following command:
aptitude show ntpdate | grep State
It shows as installed and any ntpdate commands work with no issues, so I have no idea why this is getting regularly reported?
From root@mydomain.co.uk Wed Feb 03 18:20:01 2010 Return-path: <root@mydomain.co.uk> Envelope-to: root@mydomain.co.uk Delivery-date: Wed, 03 Feb 2010 18:20:01 +0000
I wrote/cobbled-together this nifty sendmail script to read some logs and take some disk stats. basically i'm reporting on rsnapshot. When I run it as
Code: sudo /etc/rsnapshot/mailSta.sh Everything works wonderful and the emails arrive as expected and fires off an email to two accounts at a remote server
I made a Bash script that is fired by a Cron job every morning. It dumps an SVN backup on some Samba shared drive. I would like to know how I can make sure the job worked correctly without having to verify the shared drive every morning. Right now, I take the job's output, save it to a log file and send this file by email. But the ouput isn't so great.