Search Results

Search found 192 results on 8 pages for 'cronjob'.

Page 1/8 | 1 2 3 4 5 6 7 8  | Next Page >

  • PHP vs Batch file for mysql cronjob?

    - by mysqllearner
    Hi, My server details: OS: Windows Server 2003 IIS6 Plesk 8.xx installed (currently using Plesk to set the cronjob) I need your advice. I have 2 methods: Method 1: Using php + mysqldump, create databases backup files into gzip, and then send email with attachment (each databases has around about 25mb) Method 2: Using batch + mysqldump, create databases backup files into gzip, and then send email with attachment (same, each databases has around about 25mb) My questions: Whats the difference of using php file and batch file for cronjob? Which method is better in term of backup speed and send email, and (maybe)safety (e.g., lesser file corrupt occurance)? If i set the cronjob hourly, will it effect my web performances? I mean, lets say my website has 100++ users online now, and each user making transaction to MySQL, when I perform backup at my web peak hour, will it decrease the performances, like the loading speed, prone to errors etc?? (sorry for my bad english) P.S: If you need my php and batch file code, please ask me to post it here. I didnt post it now is because, its very simple and standard code.

    Read the article

  • Plesk command working in manual script, not in cronjob

    - by dsaunier
    Hi, In order to install a hosting plan, I use Plesk's commands in SSH as specified in their official guide. When typed directly in SSH (Putty), it works perfectly. The line is as follows with obviously values hard coded when in CLI: /usr/local/psa/bin/domain --create '.$url.' -owner mynamehere -ip '.IP_SERVER_PLESK.' -status enabled -hosting true -hst_type phys -login '.$ftp_user.' -passwd '.$ftp_pw.' -www false -php true -php_safe_mode false -hard_quota 100M I then put that request in a php script that does other things after hosting is installed. Now for the weird part: when calling that script from CLI it also works fine, I do a ./myscript.php and it installs the hosting, then sends emails etc. However after I create a cronjob to have that same script called regularly, then the Plesk command fails. The cronjob is started in Plesk as */15 * * * * /usr/bin/php /home/scripts/myscript.php and it works fine for everything BUT the Plesk hosting install, that returns "Unable to read Control Panel configuration file" and therefore does not install the domain hosting. Still this is the same script that I call manually ! On that server are the PHP used to call a cronjob and the one used in CLI different ? What do I miss, help greatly appreciated ! Regards.

    Read the article

  • Cronjob as root?

    - by Rob
    I'm having a bit of a problem with cronjobs for backups. I've set up the following in sudo crontab -e (not under personal account): 0 1 * * * /backups/dobackup /backups/dobackup contains this: #!/bin/sh touch ITRAN tar -cvpjf /backups/$(date +%d.%m.%Y)_backup.tar.bz2 --exclude=/backups --exclude=/proc --exclude=/lost+found --exclude=/sys --exclude=/mnt --exclude=/media --exclude=/dev / The backup file is created, but the file ITRAN is not. Also, the backup file is vastly smaller than expected: -rw-r--r-- 1 rjrudman root 371620259 2012-06-21 12:39 21.06.2012_backup.tar.bz2 -rw-r--r-- 1 rjrudman root 1023211449 2012-06-22 18:00 22.06.2012_backup.tar.bz2 -rw-r--r-- 1 rjrudman root 1512785 2012-06-23 01:00 23.06.2012_backup.tar.bz2 -rw-r--r-- 1 rjrudman root 1023272455 2012-06-24 22:41 24.06.2012_backup.tar.bz2 -rw-r--r-- 1 rjrudman root 1514027 2012-06-25 01:00 25.06.2012_backup.tar.bz2 The backups with much larger file sizes are created by manually running sudo /backups/dobackup. It seems the cronjob is failing at some point.. but I have no idea how to debug this issue or where to start. Any ideas? Running ubuntu 10.04

    Read the article

  • Running cronjob in the odd-numbered days

    - by Spacedust
    I'm currently running my MySQL backup script on every day of the week: 0 1 * * 1 sh /root/mysql_monday.sh 0 1 * * 2 sh /root/mysql_tuesday.sh 0 1 * * 3 sh /root/mysql_wednesday.sh 0 1 * * 4 sh /root/mysql_thursday.sh 0 1 * * 5 sh /root/mysql_friday.sh 0 1 * * 6 sh /root/mysql_saturday.sh 0 1 * * 0 sh /root/mysql_sunday.sh Now I would like to keep backups for one week more so two weeks in total just to be more secure. For example: I though I can create one backup file on monday in the even days and then again in the odd-numbered days. For even days I can just use: 0 1 */2 * 1 sh /root/mysql_monday_even.sh 0 1 */2 * 2 sh /root/mysql_tuesday_even.sh 0 1 */2 * 3 sh /root/mysql_wednesday_even.sh 0 1 */2 * 4 sh /root/mysql_thursday_even.sh 0 1 */2 * 5 sh /root/mysql_friday_even.sh 0 1 */2 * 6 sh /root/mysql_saturday_even.sh 0 1 */2 * 0 sh /root/mysql_sunday_even.sh But what about the odd-numbered days ?

    Read the article

  • This weird behaviour from cronjob

    - by The DOCTOR from TARDIS
    I have set the crontab like this: */5 0 * * * /www/permitChat.sh and the /www/permitChat.sh is this: # We are setting the name of file # in the variable along with complete path. sFilePath=`date +\/www\/ChatLogs\/%Y\/%m/%d_%m_%Y.txt` # First we set its permissions to # readable by all users, and then # modify them to be writable by only root. chmod a=r $sFilePath chmod u+w $sFilePath ls -lh $sFilePath The trouble I am facing is, the cron gets executed after 12:00 PM everyday, instead of executing at 12:00 AM to 01:00 AM, every 5 minutes. What could be wrong? All my system variables appear to be synced.

    Read the article

  • Running a cronjob

    - by Ed01
    've been puzzling over cronjobs for the last few hours. I've read documentation and examples. I understand the basics and concepts, but haven't gotten anything to work. So I would appreciate some help with this total noob dilemma. The ultimate goal is to schedule the execution of a django function every day. Before I get that far, I want to know that I can schedule any old script to run, first once, then on a regular basis. So I want to: 1) Write a simple script (perhaps a bash script) that will allow me to determine that yes, it did indeed run successfully, or that it failed. 2) schedule this script to run at the top of the hour I tried writing a bash script that simple output some text to the terminal: #!/bin/bash echo "The script ran" Then I dropped this into a .txt file MAILTO = *****.******@gmail.com 05 * * * * /home/vadmin/development/test.sh But nothing happened. I'm sure I did many things wrong. Where do I start to fix all of this?

    Read the article

  • Does Dropbox use a cronjob to sync up?

    - by Yko
    I was looking into lipsync on a Dropbox clone. I was looking at the diagram on how it works here. It shows that a cronjob is used to keep files in sync between client and server. Does that mean that every sec/min/hour, a cronjob runs and checks to see if there is a difference between client and server? Is that how Dropbox does it? If it does use a cronjob, what happens when you are in the middle of syncing and another cronjob runs? Does rsync (or additional libs) know how to handle this?

    Read the article

  • Script executes successfully in commandline but not as a cronjob

    - by JasonOng
    I've a bash script that runs a ruby script that fetches my twitter feeds. ## /home/username/twittercron #!/bin/bash cd /home/username/twitter ruby twitter.rb friends It runs successfully in command line. /home/username/twittercron But when I try to run it as a cronjob, it ran but wasn't able to fetch the feeds. ## crontab -e */15 * * * * * /home/username/twittercron The script has been chmod +x. Not sure why it's as such. Any ideas?

    Read the article

  • PHP/Cronjob: What is my Cronjobs problem?

    - by Marius
    Hello there, I have no idea whats going on. But I have a script that looks like this. Cron job refuses to run it: include_once 'class_lib/mime_mail/mimeDecode.php'; include_once 'class_lib/Mail/IMAPv2.php'; include_once 'inc-functions.php'; include_once "$_SERVER[DOCUMENT_ROOT]/class_lib/DbFuctioneer.php"; $dbFuctioneer = new DbFuctioneer(); Everything works well when I remove: $dbFuctioneer = new DbFuctioneer(); Even when DbFuctioneer() looks like this: <?php class DbFuctioneer { function dbCountMatches( $count) { return $count; } } Does Cron have a problem with Classes in his Jobs? Thank you for your time. Kind regards, Marius

    Read the article

  • Mac : Run Foundation Tool app as cronjob?

    - by Holli
    This may not be completely programming related ... In Xcode I wrote a little Foundation Tool application for maintenance. Copy files from A to B , delete logs and so on. Now I want to run the application in background once a day or once an hour. How do I set this up? Can it be done with a Foundation Tool application or is there another Xcode project type for tasks like this?

    Read the article

  • How do I increase timeout for a cronjob/crontab?

    - by Mohit Ranka
    I have written a script that gets data from solr for which date is within the specified period, and I run the script using as a daily cron. The problem is the cronjob does not complete the task. If I manually run the script (for the same time period), it works well. If I reduce the specified time period, the script runs from the cron as well. So my guess is cronjob is timing out while running the script is there is much data to process. How do I increase the timeout for cronjob? PS - 1. The script I am running in cronjob is a bash script which runs a python script.

    Read the article

  • Help me make a cronjob/screen command please?

    - by Josip Gòdly Zirdum
    Hi guys I want to set up a cronjob on reboot to do this cd /home/admin/vivalaminecraft.com && screen -d -m -S mcscreen && mono McMyAdmin.exe The issue is when I execute this it seems to create the screen but doesn't do the mono McMyAdmin.exe in the screen... Is there like a then command ? so it does 1. then 2. then 3. ? Could someone please help out :) So I tried this: so I did this: @reboot screen -dmS minecraft @reboot cd /home/admin/vivalaminecraft.com @reboot mono McMyAdmin.exe It still doesn't work. The screen is created but it doesn't have the mono execution in it I put this in it #!/bin/bash screen -dmS minecraft; cd /home/admin/vivalaminecraft.com; mono McMyAdmin.exe; is this correct?

    Read the article

  • How to Modify a Cronjob Email Subject

    - by justinl
    I am running a half dozen different cron jobs from my hosting at Hostmonster.com. When a cronjob has been executed I receive an email with the output of the script. The email comes in the format of: From: Cron Daemon Subject: Cron /ramdisk/bin/php5 -c /home5/username/scheduled/optimize_mysql.bash The problem with this is that the subject of the email makes it very hard to read which cronjob the email is pertaining to. Is there a way to modify the subject of a cronjob email so that it's easier to read? For example: From: Cron Daemon Subject: Optimize MySQL Database

    Read the article

  • Supervisor VS cronjob

    - by Guandalino
    Actually I'm using supervisor to monitor a process and restart it when it stops for some reason. The problem is that in case of a supervisor crash the process stops get monitored. So I thought to schedule a cronjob to check supervisor is running, and eventually restart it. The next thing I'm considering is to get rid of supervisor and check my process directly from the cronjob. I read that sometimes supervisor uses too much memory (to be verified, though). What are the pros in having supervisor VS cronjob monitoring the process?

    Read the article

  • Privileged command as part of cronjob

    - by user42756
    Hi, I'm facing a weired problem on a unix-based machine. Here is the story: I have a personal username/password on a unix machine with limited privileges. Whenever I need to execute some commands I have to substitute user using the su command, then I execute it normally. Now, I need to add a cronjob that uses such privileged commands so I added the cronjob on the crontab of the user I substituted to in order to have access to these commands. Strangely, it turned out to me that these commands fail to run for some reason as a cronjob although when I execute them directly from shell (after su) they work seamlessly. Why does this happen? Why do these commands not work as part of cronjobs? Thank you

    Read the article

  • Is it possible to make a PHP script run itself every hour or so without the use of a cronjob?

    - by Rob
    I'm pretty sure I've seen this done in a php script once, although I cant find the script. It was some script that would automatically check for updates to that script, and then replace itself if there was an update. I don't actually need all that, I just want to be able to make my PHP script automatically run every 30 minutes to an hour, but I'd like to do it without cronjobs, if its possible. Any suggestions? Or is it even possible? EDIT: After reading through a possible duplicate that RC linked to, I'd like to clarify. I'd like to do this completely without using resources outside of the PHP script. AKA no outside cronjobs that send a GET request. I'd also like to do it without keeping the script running constantly and sleeping for 30 minutes

    Read the article

  • Passing parameters to a shell script running as a cronjob

    - by Takashi
    I am new to bash scripting (not programming in general). I am writing a bash script that will run a Python script I have written. I want to be able to do the following: Pass parameters to the bash script via the cronjob (so I can have two cron jobs) one to be run with parameter 'foobar', and the other 'foo' switch based on the parameter passed to the bash script (by switching, I mean an if/else based on the paramter passed to the bash script).

    Read the article

  • Setup cronjob with SSH crontab [duplicate]

    - by user225711
    This question already has an answer here: Why is my crontab not working, and how can I troubleshoot it? 3 answers Someone can help me to setup cronjob with crontab. I have run command crontab -e -u root 01 0 * * * /usr/bin/php /var/www/web/daily/testssh.php But it always get error: crontab: usage error: no arguments permitted after this option

    Read the article

  • Load login shell inside user cronjob

    - by sa125
    I'm trying to run a rake task using a scheduled cronjob. My crontab looks something like this: 0 1 * * 1-7 /bin/bash -l -c "cd ~/jobs/rake && rake reports:create >> ~/jobs/logs/cron.log" Ruby on my account is provided by RVM, which is loaded via ~/.bashrc (before the no-interaction check): # load RVM env [[ -s $HOME/.rvm/scripts/rvm ]] && source $HOME/.rvm/scripts/rvm # If not running interactively, don't do anything [ -z "$PS1" ] && return # ... rest of logic Time and again, this task fails to run since RVM isn't loaded when the task is called (uses system's /usr/bin/ruby instead), and gem dependencies are missing. How can I make crontab load my shell environment before executing my scheduled jobs? thanks.

    Read the article

  • Cronjob not Running

    - by Pete Herbert Penito
    I have a bash script that looks like this: #!/bin/sh PID=`ps faux | grep libt | awk 'NR==2{print $2}'` STATUS=`ps faux | grep libt | awk 'NR==2{print $1}'` if [ "$STATUS" = "ec2-user" ]; then echo "libt already killed" else sudo kill $PID echo "libt was killed" fi sleep 5 cd /home/ec2-user/libt sudo ./libt I have saved this file as restart.sh and when I run it like ./restart.sh, it does what its supposed to (kills the libt process and restarts it). However, now I am trying to automate the process by using cron. So I made a cron job that I want to run every 6 hours that looks like this 0 */6 * * * /home/ec2-user/restart.sh When I run "crontab -l" I can see this print so I know it's been added properly. I should mention that the service does not have the ability to be restarted, (like "service ... restart") the process ID needs to be found, killed and then the start script needs to be ran. I have found that this cronjob is not working, I'll log onto the box and I can tell by looking at the logs that no restart has occurred. What am I doing wrong? What can I do to troubleshoot? Any advice would help, this is my first cron job :) Thanks!

    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

  • Better logging for cronjob output using /usr/bin/logger

    - by Stefan Lasiewski
    I am looking for a better way to log cronjobs. Most cronjobs tend to spam email or the console, get ignored, or create yet another logfile. In this case, I have a Nagios NSCA script which sends data to a central Nagios sever. This send_nsca script also prints a single status line to STDOUT, indicating success or failure. 0 * * * * root /usr/local/nagios/sbin/nsca_check_disk This emails the following message to root@localhost, which is then forwarded to my team of sysadmins. Spam. forwarded nsca_check_disk: 1 data packet(s) sent to host successfully. I'm looking for a log method which: Doesn't spam the messages to email or the console Don't create yet another krufty logfile which requires cleanup months or years later. Capture the log information somewhere, so it can be viewed later if desired. Works on most unixes Fits into an existing log infrastructure. Uses common syslog conventions like 'facility' Some of these are third party scripts, and don't always do logging internally. UPDATE 2010-04-30 In the process of writing this question, I think I have answered myself. So I'll answer myself "Jeopardy-style". Is there any problem with this method? The following will send any Cron output to /usr/bin//logger, which will send to syslog, with a 'tag' of 'nsca_check_disk'. Syslog handles it from there. My systems (CentOS and FreeBSD) already handle log rotation. */5 * * * * root /usr/local/nagios/sbin/nsca_check_disk 2>&1 |/usr/bin/logger -t nsca_check_disk /var/log/messages now has one additional message which says this: Apr 29, 17:40:00 192.168.6.19 nsca_check_disk: 1 data packet(s) sent to host successfully. I like /usr/bin/logger , because it works well with an existing syslog configuration and infrastructure, and is included with most Unix distros. Most *nix distributions already do logrotation, and do it well.

    Read the article

1 2 3 4 5 6 7 8  | Next Page >