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've got a bash script that uses rsync via SSH to back up data from a remote webserver. This script works fine when I run it myself but when it runs as a cron job I get the following error:
I have a script that pops up a jpg file several times a day as a reminder. The script is called up by crontab and it works perfectly.The issue is that I want the script to also perform a system "beep" in addition to popping up the jpg file. When I test it on the command line everything works but when I run it in cron the jpg file pops up but the beep doesn't beep. I'm thinking the problem is in the "echo -e \a" part. I must be missing something.Here is my script:
I have a personal server and a dynamic IP address, so I wrote a script to check the currently assigned IP address and compare it to the one stored in a file from the last check, and visit the update URL if it's different.
I have an rsync script I wrote that I have tested and it works perfectly when I run it manually. Now I am working on a server setup script and I have gotten my setup script to create the rsync script in /etc/cron.hourly and restart crond. To spite the fact that the script is in /etc/cron.hourly and I have restarted crond, the script does not run. With that said, how can I script adding the rsync script to run hourly as a cron job?
I'm trying to get cron to run a bash script every 15 minutes to change my desktop background
running crontab -e I added
Code:
*/15 * * * * sh /home/ME/Documents/scripts/background.sh
(at first i didnt have the sh before the path of the script but read somewhere i needed that) But it doesnt seem to be running my script works fine if ran straight from the terminal so Dont think thats the problem.
I'm really running into a wall trying to figure this out. I have a Bash script and narrowed down the one command that doesn't seem to work via cron and it's my pgp decrypting line. Works fine if I run the command via terminal but if I run it via cron it doesn't output anything.crontab -e shows the cronjob and it runs, creates the log file with no output. Is there maybe something I need to run as well? Permissions look set, unless the cron is running as a different user(was under the assumption if it showed up under crontab while logged into that user, then it would run as that user.
I have a script that that is supposed to send me an e-mail when a host is not responding to ping:
The script works fine when I execute it directly but when cron executes it, the ping error is never picked up by the script so the if statement is ignored.
Script programming question for the experts. I have written a bash script that works fine if I execute from the shell interactively. However, once I schedule it to be executed via cron, it just wouldn't work. I believe this has to do with cron running in a different environment than the one I am in when I putty in.
The bash shell script does refer to environment variables in the .cshrc file. I guess these aren't available to the cron? How can I load them into the script if I want them to be available to the cron locally within the script?
I have script which does file locking via flock and then writing it's pid into that file. It perfectly works being run by hand in terminal, running under cron on Debian, but somehow fails being run under cron on Centos 5.6. Script part and straced outputs are below.
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'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 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.
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.
I'm running a cron job every night to dump a MySQL database to an external hard drive. It works, however when I check on it the following morning the external is no longer mounted and the XFS log file is corrupted. If I run
Code: xfs_repair -L /dev/sdf1 It works, but then I get these issues: Code: XFS: Filesystem sdf1 has duplicate UUID - can't mount I can reset the UUID, but it's difficult to have to do this every day.
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: