Ubuntu Servers :: Getting Emails From Failed Cron Jobs?
Jan 16, 2011
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.
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.
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.)
I have this in my crontab (along with another line before it):
Code: * * * * * /bin/echo "Does this work?" > ~/test ...and the file doesn't show up. I have a blank line after that one in the crontab. I have no /etc/cron.allow or /etc/cron.deny files. I'm running Ubuntu 11.04. /var/log/syslog shows "BEGIN EDIT" and "END EDIT" etc. when I run crontab -e, but doesn't say anything about trying to run commands. Anything I might be missing?
It is correct, I want it to execute every minute. Now, I copied the same script to ubuntu maverick, and it doesn't run. Perhaps there's some ubuntu peculiarity that I'm not aware of?
I want to add two separate tasks/jobs to Cron that needs to run every 10 minutes, but I would like the second job to kick off only 5 minutes after the first job. Is there any way this could be done within Cron?
run a cron job to download my email logs to my laptop. But the question is HOW? Im not sure how to write the php script for the cron job. the file is on "computer A" and the file is setup to chmod I just need to know how to write the php to "access" the other computer and then download the file to a certain file on my laptop.
I have a Fedora 11 box and I am confused about cron, where exactly do I enter the cron jobs? For example, I have a job that needs to run every half hour.
Cron doesn't run jobs in Debian 64 (testing). It gives error Code: Apr 6 15:31:01 debian64 /USR/SBIN/CRON[5454]: (CRON) Error (grandchild #5455 failed with exit status 1) and does not run the script.
I have a file server that is an NIS client. User home directories are auto-mounted from another server. Users are not able to run cron jobs. The /var/log/cron logs says: Jan 6 14:33:01 inclination crond[3217]: (username) ORPHAN (no passwd entry)
I tried adding an entry in /etc/passwd, /etc/group, and /etc/shadow but the test script I have still doesn't seem to run although cron thinks it did. The log entry for these attempts looks like: Jan 6 15:30:01 inclination crond[4312]: (username) CMD (/home/username/test-script)
Now root does seem to be able to run cron jobs with no problem. My test script works fine from cron when runs as root. I suspect there's an issue with how I have NIS configured but I can't find any info. The test script runs fine from the command line when logged in as myself.
By default, cron jobs are scheduled to run at 4:40 IIRC. I have my computer set to suspend after half an hour of inactivity so, except for some all-nighters, pretty much every day at that time my PC is suspended. What happens to the cron jobs? I don't suppose they run while the suspension is in effect. Do they get run when the computer wakes up or does cron wait until the next day at 4:40 to run the jobs?
Just curious if this is possible. What I want to do is setup a rsync job to backup my laptop to my personal file server(same LAN), but I want it do do this at 3AM while I'm sleeping. However I always close my laptop lid when I'm done using it which puts the laptop into suspend mode since that's how I configured my power options in gnome. Since I don't want to leave my laptop powered up all the time, I was wondering if it is possible to have a cron job scheduled that will wake the laptop up(out of suspend mode) and run my script/backup job, all without opening the lid of the laptop, and then put it back into suspend mode when it's done. Is this possible, and is it as easy as scheduling a cron job or is there some other scripting/configuration/trickery that I need to do to accomplish this?
Also, my laptop's BIOS has the option to power on at a scheduled time if needed, but I'm not sure if that would work with it being suspended(hibernation is not an option since my entire HD is encrypted with LUKS and I would have to be present to enter the password to boot the system.).
I have a XEN DomU VM running Lenny and set up using debootstrap. I also have the TimeWentBackwards issue sorted using: [URL]. The problem is that my cron jobs just don't run. I've set up a cron job that simply echoes a date string to a file as a tester but it's not running. I've tried it under the root crontab, in /etc/crontab and set up in /etc/cron.daily. Is there something I'm missing?
job #1: runs Mon, Tue, Wed, Thu, Fri, Sun at 9PM every month except for 15th job#2: runs on 15th of each month at 9PM job #3: runs every Saturday at 6PM every month
What is the correct syntax for this kind of scheduled cron jobs?
in my linux box i have lot of cron jobs. i need to make all cron jobs in script files. is it possible to make this. like[URL]Now how i change this in a script file
My server... its CentOS (redhat alike). I need to make the server disable apache server then run mysql command to optimize the databases then re-enable apache server in a specific time daily. Is it possible?
I am looking to send emails from cron for backup information. However, all the programs I have found (mail, mutt) require the password in plain text. Does anyone know of a more secure method? In fact, if it is only sending, is there a way to do this without logging into an account? What is the simplest way, without making it check emails too?
I have a Cent OS dedicated server, not sure what version though as I'm new to Linux. How do I find out what version I have? Is there an anti virus or security package that I can install on my server which can use Cron Jobs to do a scan every 12 hours.
Since we switched our server to Squeeze, I'm receiving emails from the cron about a mysql error (...can't use locks with log tables). But this is not the issue I want to talk about here. The issue is that since the executed command is: /usr/bin/mysqlcheck -uroot -pmypassword --all-databases --check-only-changed --silent which is a command that was automatically added to the cron by the mysql package (I believe), the password is sent in clear text in the email's subject. In my sense, this is a serious security issue (sending root password in email subject...)
I don't know at what level it should be corrected, but it seems to me like it should be corrected in the Debian distrib, shouldn't it ?
And for now, how can I hide the password in the emails I receive ?
I'm going to be setting up a couple of servers for some friends. I'd like them to be able to email me some information after they do some maintenance scripts via cron. I got my own server to send email using a tutorial I found but that involved using my personal gmail account. getting email sending working on ubuntu server with minimal fuss and account credential exposure?