Search Results

Search found 1134 results on 46 pages for 'cron'.

Page 3/46 | < Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >

  • Sending cron output to a file with a timestamp in its name

    - by Philip Morton
    I have a crontab like this on a LAMP setup: 0 0 * * * /some/path/to/a/file.php > $HOME/cron.log 2>&1 This writes the output of the file to cron.log. However, when it runs again, it overwrites whatever was previously in the file. How can I get cron to output to a file with a timestamp in its filename? An example filename would be something like this: 2010-02-26-000000-cron.log I don't really care about the format, as long as it has a timestamp of some kind. Thanks in advance.

    Read the article

  • Running git-svn with cron results in garbage in .git

    - by Paul
    I've setup a git-svn repo with cron to fetch from the svn repo daily. I have a script to do the fetching, and this is what is invoked by cron. Everything is fine with the repo, and the script works fine when executed manually. However, when it runs under cron, empty files get dropped into the .git directory. The files have names that look like they are some base64 output, e.g. juTrvjP6m8 and kcKf3hu3b4. Two of these files show up for every cron run. I thought these might be commit hashes, but they're not, git-show says it's an unknown revision. I set-up the repo as follows: git svn init http://svn.ip.addr/repo git svn fetch svn-remote My script looks like this: cd /gitsvn/dir git svn fetch svn-remote git svn push pub The last line pushes the repo to a separate (bare) public repo from which others can clone. I'm piping the output from the cron job to a file, which looks like this: fatal: unable to run 'git-svn' Counting objects: 21, done. Delta compression using up to 2 threads. Compressing objects: 100% (10/10), done. Writing objects: 100% (11/11), 59.08 KiB, done. Total 11 (delta 8), reused 0 (delta 0) To /gitpub/repo.git 360faf5..a153b0d trunk -> trunk The line "fatal: unable to run 'git-svn'" is alarming, but the fetch seems to go ahead anyway. Any suggestions? Where are these empty garbage files coming from, and how to stop them? Am I in for bigger problems in the future? BTW, I'm using git 1.6.3.3.

    Read the article

  • Cron won't use msmtp to send emails in case of failed cronjob

    - by Glister
    I'm trying to configure a machine so that it will send me an email if one of the cronjobs output something in case of an error. I'm using Debian Wheezy. Cron is working normally (without the email functionality). msmtp is installed and configured. Have already symlinked /usr/{bin|sbin}/sendmail to /usr/bin/msmtp. I can send email by using: echo "test" | mail -s "subject" [email protected] or by executing: echo "test" | /usr/sbin/sendmail Without the symlink (/usr/sbin/sendmail) cron will tell me that: (CRON) info (No MTA installed, discarding output) With the symlinks I get: (root) MAIL (mailed 1 byte of output; but got status 0x004e, #012) Can you suggest how to config the cron/msmtp pair? Thanks! EDIT: Note: I've written "msmtpd" by mistake. Its not a daemon but rather an SMTP client named just "msmtp" (without the "d" ending). It is executed on demand and it is not running in the background all the time. When I try to send an email by using msmtp like that it works: echo "test" | msmtp [email protected] On the far side, in the logs of the SMTP server I read: Nov 2 09:26:10 S01 postfix/smtpd[12728]: connect from unknown[CLIENT_IP] Nov 2 09:26:12 S01 postfix/smtpd[12728]: 532301C318: client=unknown[CLIENT_IP], sasl_method=CRAM-MD5, [email protected] Nov 2 09:26:12 S01 postfix/cleanup[12733]: 532301C318: message-id=<> Nov 2 09:26:12 S01 postfix/qmgr[2404]: 532301C318: from=<[email protected]>, size=191, nrcpt=1 (queue active) Nov 2 09:26:12 S01 postfix/local[12734]: 532301C318: to=<[email protected]>, orig_to=<[email protected]>, relay=local, delay=0.62, delays=0.59/0.01/0/0.03, dsn=2.0.0, status=sent (delivered to command: IFS=' ' && exec /usr/bin/procmail -f- || exit 75 #1001) Nov 2 09:26:12 S01 postfix/qmgr[2404]: 532301C318: removed Nov 2 09:26:13 S01 postfix/smtpd[12728]: disconnect from unknown[CLIENT_IP] And the Email is delivered to the target user. So it looks like that the msmtp client is working properly. It has to be something in the cron/msmtp integration, but I have no clue what that thing might be. Can you help me?

    Read the article

  • Cron won't use msmtpd to send emails in case of failed cronjob

    - by Glister
    I'm trying to configure a machine so that it will send me an email if one of the cronjobs output something in case of an error. I'm using Debian Wheezy. Cron is working normally (without the email functionality). msmtp is installed and configured. Have already symlinked /usr/{bin|sbin}/sendmail to /usr/bin/msmtpd. I can send email by using: echo "test" | mail -s "subject" [email protected] or by executing: echo "test" | /usr/sbin/sendmail Without the symlink (/usr/sbin/sendmail) cron will tell me that: (CRON) info (No MTA installed, discarding output) With the symlinks I get: (root) MAIL (mailed 1 byte of output; but got status 0x004e, #012) Can you suggest how to config the cron/msmtp pair? Thanks!

    Read the article

  • Cron ignoring an update to crontab

    - by GJ
    I've commented out a line in the crontab on a debian server, which I guess was there by default yet was causing me to get error emails every hour: # m h dom mon dow user command 17 * * * * root cd / && run-parts --report /etc/cron.hourly However, the error emails keep coming in as if it hasn't been commented out. The error emails: Subject: Cron <root@(none)> root cd / && run-parts --report /etc/cron.hourly (failed) /bin/sh: root: not found Any ideas?

    Read the article

  • Evaluate cron expression

    - by Jake A. Smith
    Is there a command line tool that will simply evaluate a cron expression and return a bool response if it is supposed to be running right now? I'm looking for something I can use as a utility in another bash script. Something like so: run_script=$(/tools/evaluate-cron-expression "02 4 * * *") if [ "$run_script" -eq "1" ] # etc etc I know, I know, I could just setup a real cron job, but I'm playing with the idea of wrapping all of my scheduled scripts inside of another script.

    Read the article

  • Techniques to Monitor cron tasks?

    - by Tristan Juricek
    Are there good techniques for monitoring cron tasks over a cluster? We're starting to use cron to launch tasks at daily intervals. A few ideas for checking out information: Add special application handling that logs information into some "network aware" place, like a DB Build up a logfile system that transfers the cron log periodically to a central point for processing/querying (along with other possible log files) I'm wondering if people have had success with doing things separately for cron versus other things, or, if the tasks were integrated into a different approach completely. I'm leaning towards #2, but I'd like to know what more experienced folk might try out.

    Read the article

  • Cron Jobs unable to deliver email error report

    - by root
    I am sure I have right syntax and I am still unable to receive report emails to my email address. My OS is CentOS 6.4. My Crontab script is MAILTO="[email protected]" * * * * * /usr/bin/php5 /home/myusername/public_html/cron.php /post/find_submit_test/1/ Email address [email protected] is working fine and I tested sendmail from ssh which is too working fine but cron reports are unable to be delivered. I checked WHM for notification settings couldn't even find anything relevant there. Please advice me how to fix this. Thanks

    Read the article

  • "killed" message from cron.daily, but not when run from command line

    - by Dan Stahlke
    On Fedora 17, I put a file into /etc/cron.daily with the following contents: cd / su dstahlke /home/dstahlke/bin/anacron-daily.sh exit 0 For some reason, I get a mail every day that just says /etc/cron.daily/dstahlke-daily: ...killed. I tried with and without the exit 0 line above (I noticed that some system scripts have that and others don't, I'm not sure of the purpose). Running /etc/cron.daily/dstahlke-daily from the command line as root produces no ...killed message. Other than the message, everything seems to work fine. Putting set -x in the above script, as well as in the /home/dstahlke/bin/anacron-daily.sh script shows that the ...killed message happens just after the latter script terminates (or perhaps just after the su command finishes). What causes the ...killed message? Or, is there a more acceptable way to have anacron run a user script daily? I figured that putting this in /etc/cron.daily would help the system coordinate all of the daily tasks rather than potentially running my task concurrently with the system tasks.

    Read the article

  • run cron on ssh, error message

    - by user1790649
    how to run the script below * * * * * /usr/bin/wget -O - -q "http://example.com/scheduler/cron" when i run the script, the error message show as below: $ * * * * * /usr/bin/wget -O - -q "http://website.com/?q=admin/settings/scheduler/cron" -sh: CHANGELOG.txt: not found $ 30 15 * * * /usr/bin/wget -O - -q "http://website.com/?q=admin/settings/scheduler/cron" -sh: 30: not found can the script above run in ssh (using putty software)

    Read the article

  • cron+pam heavily spamming my logs

    - by Lo'oris
    Two times every minute I get this in auth.log: May 12 15:21:01 ruptai CRON[25303]: pam_unix(cron:session): session opened for user root by (uid=0) May 12 15:21:01 ruptai CRON[25303]: pam_unix(cron:session): session closed for user root This never stops, two times every minute, every minute of every day. I've no idea what it is, I would just to stop it from pointless logging this stuff. This has been going on for ages so I can't recall when it started. OS is debian stable. Btw, I've found questions on google but no answers

    Read the article

  • Why does cron.hourly not care about the existence of anacron?

    - by Oliver Salzburg
    This question came up over in Root Access. Why does the default /etc/crontab not check for existence (and executable flag) of /usr/sbin/anacron for the hourly entry? My /etc/crontab: # 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 ) What makes hourly different from the others?

    Read the article

  • Node.js Cron Job Messing with Date Object

    - by PazoozaTest Pazman
    I'm trying to schedule several cron jobs to generate serial numbers for different entities within my web app. However I am running into this problem, when I'm looping each table, it says it has something to do with date.js. I'm not doing anything with a date object ? Not at this stage anyway. A couple of guesses is that the cron object is doing a date thing in its code and is referencing date.js. I'm using date.js to get access to things like ISO date. for (t in config.generatorTables) { console.log("t = " + config.generatorTables[t] + "\n\n"); var ts3 = azure.createTableService(); var jobSerialNumbers = new cronJob({ //cronTime: '*/' + rndNumber + ' * * * * *', cronTime: '*/1 * * * * *', onTick: function () { //console.log(new Date() + " calling topUpSerialNumbers \n\n"); manageSerialNumbers.topUpSerialNumbers(config.generatorTables[t], function () { }); }, start: false, timeZone: "America/Los_Angeles" }); ts3.createTableIfNotExists(config.generatorTables[t], function (error) { if (error === null) { var query = azure.TableQuery .select() .from(config.generatorTables[t]) .where('PartitionKey eq ?', '0') ts3.queryEntities(query, function (error, serialNumberEntities) { if (error === null && serialNumberEntities.length == 0) { manageSerialNumbers.generateNewNumbers(config.maxNumber, config.serialNumberSize, config.generatorTables[t], function () { jobSerialNumbers.start(); }); } else jobSerialNumbers.start(); }); } }); } And this is the error message I'm getting when I examine the server.js.logs\0.txt file: C:\node\w\WebRole1\public\javascripts\date.js:56 onsole.log('isDST'); return this.toString().match(/(E|C|M|P)(S|D)T/)[2] == "D" ^ TypeError: Cannot read property '2' of null at Date.isDST (C:\node\w\WebRole1\public\javascripts\date.js:56:110) at Date.getTimezone (C:\node\w\WebRole1\public\javascripts\date.js:56:228) at Object._getNextDateFrom (C:\node\w\WebRole1\node_modules\cron\lib\cron.js:88:30) at Object.sendAt (C:\node\w\WebRole1\node_modules\cron\lib\cron.js:51:17) at Object.getTimeout (C:\node\w\WebRole1\node_modules\cron\lib\cron.js:58:30) at Object.start (C:\node\w\WebRole1\node_modules\cron\lib\cron.js:279:33) at C:\node\w\WebRole1\server.js:169:46 at Object.generateNewNumbers (C:\node\w\WebRole1\utils\manageSerialNumbers.js:106:5) at C:\node\w\WebRole1\server.js:168:45 at C:\node\w\WebRole1\node_modules\azure\lib\services\table\tableservice.js:485:7 I am using this line in my database.js file: require('../public/javascripts/date'); is that correct that I only have to do this once, because date.js is global? I.e. it has a bunch of prototypes (extensions) for the inbuilt date object. Within manageSerialNumbers.js I am just doing a callback, their is no code executing as I've commented it all out, but still receiving this error. Any help or advice would be appreciated.

    Read the article

  • How to effectively execute this cron job?

    - by Lost_in_code
    I have a table with 200 rows. I'm running a cron job every 10 minutes to perform some kind of insert/update operation on the table. The operation needs to be performed only on 5 rows at a time every time the cron job runs. So in first 10 mins records 1-5 are updated, records 5-10 in the 20th minute and so on. When the cron job runs for the 20th time, all the records in the table would have been updated exactly once. This is what is to be achieved at least. And the next cron job should repeat the process again. The problem: is that, every time a cron job runs, the insert/update operation should be performed on N rows (not just 5 rows). So, if N is 100, all records would've been updated by just 2 cron jobs. And the next cron job would repeat the process again. Here's an example: This is the table I currently have (200 records). Every time a cron job executes, it needs to pick N records (which I set as a variable in PHP) and update the time_md5 field with the current time's MD5 value. +---------+-------------------------------------+ | id | time_md5 | +---------+-------------------------------------+ | 10 | 971324428e62dd6832a2778582559977 | | 72 | 1bd58291594543a8cc239d99843a846c | | 3 | 9300278bc5f114a290f6ed917ee93736 | | 40 | 915bf1c5a1f13404add6612ec452e644 | | 599 | 799671e31d5350ff405c8016a38c74eb | | 56 | 56302bb119f1d03db3c9093caf98c735 | | 798 | 47889aa559636b5512436776afd6ba56 | | 8 | 85fdc72d3b51f0b8b356eceac710df14 | | .. | ....... | | .. | ....... | | .. | ....... | | .. | ....... | | 340 | 9217eab5adcc47b365b2e00bbdcc011a | <-- 200th record +---------+-------------------------------------+ So, the first record(id 10) should not be updated more than once, till all 200 records are updated once - the process should start over once all the records are updated once. I have some idea on how this could be achieved, but I'm sure there are more efficient ways of doing it. Any suggestions?

    Read the article

  • cron not even sending local mail to /var/mail/

    - by Yang
    I'm using a very plain Ubuntu Server 9.04, and cron isn't delivering any mail to my /var/mail/USER (the file hasn't even been created). Here's my full crontab: # m h dom mon dow command 15 * * * * $HOME/.cron/sync-bookmarks.bash If I add # m h dom mon dow command 15 * * * * $HOME/.cron/sync-bookmarks.bash >& /tmp/log then I see the stdout and stderr in /tmp/log. I'm not (yet) interested in actual remote email delivery, just local delivery to the mail spool file. Why isn't mail working? Thanks in advance for any tips.

    Read the article

  • Cron stopped working, partially working.

    - by Robi
    Our cron script stopped working in different dates in August. What can be the possible reasons? We did not change anything. Our hosting showed us a log where we can see that cron is executing our scripts. But, nothing is happening in our scripts. If we manually execute the scripts, we're getting correct results like before. I showed the commands to hosting and they showed me that the commands are working. What should I tell my hosting? what should I do? They are php scripts which are executed by CRON and they just post to facebook and twitter. They don't execute any hard or huge things. I even asked my hosting if we broke any rules.

    Read the article

  • 403 forbidden error from cron

    - by user112570
    I have some php code that runs fine in a browser but now I want to use the same code and execute it from a cron script I'm getting issues. i tried the command on cron wget -O /dev/null http://www.mydomain.com/test.php but if i try that in the terminal i get the error below. What is the correct command to run a php file from cron? and do I need to add extra line of code to the top of my php file? The problem I'm getting is -bash-3.2$ wget -O /dev/null http://www.mydomain.com/test.php --2012-04-08 15:59:41-- http://www.mydomain.com/test.php Resolving www.mydomain.com... 46.***.***.1 Connecting to www.mydomain.com|46.***.***.1|:80... connected. HTTP request sent, awaiting response... 403 Forbidden 2012-04-08 15:59:41 ERROR 403: Forbidden. I gave the file 755 permissions and even 777 permissions, but can't see what I'm doing wrong.

    Read the article

  • Queue'ing cron jobs up to 10 times

    - by webnoob
    Hi All, This kind of touches on another post I made but is different so I have posted it as a new question. I have a script that runs that may take just over 1 minute to process, and my cron is set to run every minute. I can stop another cron job executing the script if the first one hasn't finished by using flock (php) in the file, however, this means that I would lose one iteration of the routine and have to wait nearly a minute before it is triggered again (as my understanding leads me to believe). What I would like to do is if the script is locked, not bomb out, but wait. Over time however, this could get quite high so I would also like to limit the amount of queued cron's to 10. I am a real newbie with Linux (had a Linux VPS for 3 days now) so I am not sure if my solution is even practical. Thanks.

    Read the article

  • btrfs won't run from cron

    - by Mikkel
    I'm trying to set up a cron job to create a btrfs subvolume snapshot of my root partition. The command works perfectly if I run it from the command line, but nothing happens at the scheduled cron time. I've tried piping to logger and redirecting stdout/stderr to file, and not only is there no content, the file I'm logging to isn't even created. The cron command I have is as follows: 0 0 * * * /sbin/btrfs subvolume snapshot / "/snapshots/$(date +%Y-%m-%d)" I've tried prefixing it with /bin/bash, but that makes no difference. What am I missing?

    Read the article

  • Cron job failing to backing up a Postgres database

    - by user705142
    I'm unsure what's going on here: I've got a backup script which runs fine under root. It produces a 300kb database dump in the proper directory. When running it as a cron job with exactly the same command however, an empty gzip file appears with nothing in it. The cron log shows no error, just that the command has been run. This is the script: #! /bin/bash DIR="/opt/backup" YMD=$(date "+%Y-%m-%d") su -c "pg_dump -U postgres mydatabasename | gzip -6 > "$DIR/database_backup.$YMD.gz" " postgres # delete backup files older than 60 days OLD=$(find $DIR -type d -mtime +60) if [ -n "$OLD" ] ; then echo deleting old backup files: $OLD echo $OLD | xargs rm -rfv fi And the cron job: 01 10 * * * root sh /opt/daily_backup_script.sh It produces a database_backup file, just an empty one. Anyone know what's going on here?

    Read the article

  • Help updating cron entry using regular expressions

    - by Uday
    hi I am trying to update a cron entry NOT by using crontab -e but by shell commands. For example the cron entry is like this: 10 * * * * /home/localuser/foo.sh -b 1 -h 4 > foo_output.sh 2>&1 No i need edit the command line parameters part ONLY i.e -b 1 -h 4 to something else which will be coming in from the user. First thing would be to write the crontab to a tmp file and then manipulate that temp file. Now, is there an easy way to edit that line using SED or something? The crude way wud be to delete that entire line, write a new line with the entire expression and then load that into the cron. I am not very good with regular expressions. My system supports sed -i so was thinking this could be done in a single line command. Thanks in advance

    Read the article

  • ejb timer service vs cron

    - by darko petreski
    Hi Ejb timer service can start some process in desired time intervals. Also we can do the same thing with cron (min 1 minute) interval. But doing it with cron we have more power on controlling, monitoring and changing the intervals. Also we can restart if needed the cron very easily by command line. Also we can add or remove lines in the cron transparently. What are the advantages of using ejb timer services over calling the ejbs from cron ? (several lines of code in the cron classes are not a problem) Regards.

    Read the article

  • Limit the number of cron jobs runnging a PHP script

    - by ed209
    I have a daily cron job that grabs 10 users at a time and does a bunch of stuff with them. There are 1000's of users that are part of that process every day. I don't want the cron jobs to overlap as they are heavy on server load. They call stuff from various APIs so I have timeouts and slow data fetching to contend with. I've tried using a flag to mark a cron job as running, but it's not reliable enough as some PHP scripts may time out or fail in various ways. Is there a good way to stop a cron job from calling the PHP script multiple times, or controlling the number of times it is called, so there are only 3 instances for example? I'd prefer a solution in the PHP if possible. Any ideas? At the moment I'm storing the flag as a value in a database, is using a lock type file any better as in here http://stackoverflow.com/questions/851872/does-a-cron-job-kill-last-cron-execution ?

    Read the article

  • load a php page with a cron job

    - by s2xi
    I am using a cron job to reload my httpd service after a subdomain is created. I have the problem that when the reload happens the page that registers the user throws a server error. I was wondering if I could go around this by having another cron task. So my logic would be: httpd reload after a .conf file is created then take the user back to the DocumentRoot of the main page. So in usage it would be: a user registers, then is automatically taken back to domain.com

    Read the article

< Previous Page | 1 2 3 4 5 6 7 8 9 10 11 12  | Next Page >