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 put in my cron entries to run my backup script which rsyncs my data to my 2nd drive, however on a hunch I checked my backup drive which mounts automatically via fstab and I realize it had not ran in a while. I checked cron and there were no entries for it. I got to wondering if I should ever be worried about a cron update coming down and over-writing my existing cron file with the backup entries in it to run.
I have a php script that checks versions of a remote stock file every 15 minutes. When it discovers that a new version is available it downloads the new file and runs it through a series of scripts that prepare it for an e-commerce application. It takes about an hour to import the file and process it. Otherwise, it echos "file on remote host not newer than local file". The stock file is updated every 3 or four hours and it's never at the same time. So we would like to run this script every 5, 10, or 15 minutes to make sure we have updated files.
So what happens when my php script finds a new file and takes an hour to do its work? Will the cron be activated three more times during this span? In other words, will it keep starting over even if its still running from a previous cron? Is there a way to stop the cron from running while the file download and processing occur, and then resume when its finished?
I am trying to set up a script that uses SCP and will run via cron to go out 3 nights a week and pull down the zip files that are created of my website on my hosting server. I am having trouble setting up the SCP script that will automate this. I don't want to have to enter a password each time. I know this can be done with public/private keys but need help with the syntax. Below is an example of what I have.
I have two shell scripts, one has to run after the other has finished running.I know that in cron.monthly they run in alphabetical order, but does each one run after the other has completed, or is it possible that the first may still be processing when the second is run?
I'm having a script / cron problem. i'm trying to run a script that backs up a postgresql database using a pgdump command.
I've included a simplified version of my script here.
The pgdump works fine, and outputs an SQL file.
The problem is with the tar command. it fails to correctly tar, and then compress, the .sql file when the .sh script is run from cron. but when run manually from command line (with sudo) it works well. Note ls -l printout, where the top lines were generated by cron (and tar & tar.gz are minisule), whereas in the second group the tar and tar.gz are much larger (and correct).
Note that the .sh script is owned by root, who is also the user in the cron entry. I tried using postgres as the user for all those, but i think i then had password problems. should i be using some kind of "credential"?
Here is the script and cron entry (cron in test mode to produce every 2 minutes):
Code: command failed with exit status 1 /bin/bash: -c: line 0: unexpected EOF while looking for matching ``' /bin/bash: -c: line 1: syntax error: unexpected end of file I tried a slightly different syntax:
I have a simple script. When I run it as cron job. I jot email saying:/bin/sh: line 1: test.tmp: command not found.Even I took first line out, I got the same error.The current shell I have is /bin/tcsh.
The problem is I need the php program to send member email confirmation which contains a confirm link. Run every min may still make the member wait. So I like to make it to run every 20 or 30 secs.
I don't want to put the code to send email on my sign up page as that's no good.
But I don't want to put a sleep 30 sec on my php script and going on loop. If it failed in the middle then it may wait abit to start.
What can be done to achieve my goal and what's the best way?
Making a php script to run as a daemon process? Is that possible and okay?
I've written a shell script to back up a database.
But when I run it, it prompts for password even though the script provides it. If I'm doing this manually, it's not a problem, but I want to make a cron job to do it...
Here's the script: Quote: #!/bin/bash set -xv #First let's rotate the backup files... /bin/mv /home/cabazio/someDB-3.tar.gz /home/some/someDB-4.tar.gz /bin/mv /home/some/someDB-2.tar.gz /home/some/someDB-3.tar.gz
Is there a command that can be run to verify that a users cron job has run successfully? Platform is Ubuntu 8.04 LTS.
I have scripts in /home/useraccount/bin/ running crontab -l
While logged in as user results in: # m h dom mon dow command @hourly /home/useraccount/bin/script_1 @hourly /home/locateruser/bin/script_2 I realize scripts could send email or write to a log with a timestamp, but wondering if there is just a way to verify it ran from the command line.
I ran ps -ef|grep cron ... and it shows root 4358 1 0 Mar12 ? 00:00:00 /usr/sbin/cron Not sure if this indicates it is running the jobs though....
I need to run a script when i login for first time in a day. I may reboot or shutdown and then power on during the day. But i do not want the job to run during those power ups. It should run only once per day.
I have a cron job that executes a rake task in rails. I noticed in the log that it was running the task 4 times everytime it was executed. The problem is that there are 4 instances of cron running.
I ran code...
So my question is how do I stop the other instances. When I run the stop command now I get this:
Stopping crond: cannot stop crond: crond is not running. [FAILED]
Any ideas? Do the other instances have different names? Is there a way to kill all instances as once?
I'm having a small issue where the backup jobs that I set to run in the crontab of the backup user do not appear to be running. Here's how I set it up (with crontab -e as the backup user):
run amanda every night (check at 2:45 and backup at 3)
I have 3 cronjobs set up on my Unix server . Out of which 2 cron jobs run the same script but at different times and the other one runs another script. So in the 2 jobs which are set to run PMDaily.sh for eg , One runs on Sunday at 8AM and the other runs monday to friday at 6 AM . How ever the Sunday cronjob works (runs through the crontab) but the Cron job set for Monday to Friday is not working. However manually if i run this script it workd perfectly.
Please let me know what could be the possible reasons for this?
that would show me at least any active ftp connects started with the ftp command, right? Is there then a way to use that to somehow kill any stuck sessions that are older than an hour?
How to create a cron file that will regularly perform the following backups: a. Performs a level 0 backup once per month b. Performs a level 2 dump one day per week c. Performs a level 5 dump every day that neither a level 0 nor a level 2 dump is performed. In the worst case, how many restores would you have to perform to recover a file that was dumped using this schedule.
i want to install new softwares using cron , i tried shell script : apt-get -y install packname and run the script using cron. it is not working so then i installed cron-apt but i am not able to understand how to use it
iam try to schedule my job in a file made in /etc/cron.d file as follows* * * * * tomcat6 /home/etika/Desktop/eka.sh /home/etika/Desktop/ea/etika.txt abc@gmail.comwhere eka.sh belongs to etika which is the root and etika.txt belong to tomcat6 this command is not running iam confused about the name of the owner written after the *'s please tell me whose name is written after the *'s(the schedule of the script) the owner of the script or the owner of the file which iam passing as an argument to the shell script