Questions Tagged With crontabhttp://linuxexchange.org/tags/crontab/?type=rssquestions tagged <span class="tag">crontab</span>enSun, 03 Mar 2013 12:14:59 -0500Running bash file in sudo crontab seems to failhttp://linuxexchange.org/questions/3053/running-bash-file-in-sudo-crontab-seems-to-fail<p>I am trying to run the script below in a crontab to keep my ip upto date.</p> <pre><code>#!/bin/bash clear echo "my ip form opendns: " dig @208.67.222.220 myip.opendns.com +short `hostname` echo "----------------------------- " echo "" myips=$(dig @208.67.222.220 myip.opendns.com +short `hostname`) arryIP=(${myips// / }) echo "should have found my IP address now: ${arryIP[0]}" echo " " echo "updating home.houseofhawkins.com: " echo "----------------------------------" curl <a href="https://www.cloudflare.com/api_json.html">https://www.cloudflare.com/api_json.html</a> \ -d "a=rec_edit" \ -d "tkn=mycode" \ -d "id=myid" \ -d "email=myemail" \ -d "z=myzone" \ -d "name=home" \ -d "type=A" \ -d "content=${arryIP[0]}" \ -d "ttl=120" </code></pre> <p>echo "" echo "done updating home.houseofhawkins.com..."</p> <p>if I do </p> <pre><code>. /home/me/updateIp.sh </code></pre> <p>This script will run successfully, but if I put this into a crontab it will always fail:</p> <pre><code>*/1 * * * * . /home/jon/updateIp.sh &gt;&gt; /home/jon/updateIpScript.log </code></pre> <p>the log file will have:</p> <pre><code>my ip form opendns: 86.180.163.89 67.215.65.132 ----------------------------- </code></pre> <p>Not sure what is wrong</p>twiggySun, 03 Mar 2013 12:14:59 -0500http://linuxexchange.org/questions/3053/running-bash-file-in-sudo-crontab-seems-to-failcrontabbashcronjob to run a command at first friday of each monthhttp://linuxexchange.org/questions/2940/cronjob-to-run-a-command-at-first-friday-of-each-month<p>hi there<br> i use <code>3 13 1-7 * 5</code> in cron jobs to run my command at first friday of each month,<br> but i see that the command run on days 1 - 7 and also all fri day!<br> then i found below note in wikipedia:<br> </p> <blockquote> <p>if both "day of month" and "day of week" are restricted (not "*"), then either the "day of month" field (3) or the "day of week" field (5) must match the current day.<br> </p> </blockquote> <p>so, how i can solve the problem?</p>www_9px_irThu, 04 Oct 2012 11:03:50 -0400http://linuxexchange.org/questions/2940/cronjob-to-run-a-command-at-first-friday-of-each-monthcrontablinuxshell script of mysqldump works fine when run manually, but does not run in the cron job ?http://linuxexchange.org/questions/2792/shell-script-of-mysqldump-works-fine-when-run-manually-but-does-not-run-in-the-cron-job<p>hi. i have a shell script to get a mysql db dump. this script works fine when run manually</p> <pre><code>#!/bin/sh fqn=/home/Mysqluser/daily_dumps/bookstore_`date +%Y%m%d_%H%M%S`.sql.gz mysqldump -u root -h localhost -pmysql#passwd bookstore | gzip &gt; $fqn </code></pre> <p>but when i include this script to be run in cron job, it doesnt make the backup</p> <p>this is what i included in the cron job</p> <pre><code>00 00 * * * /home/Mysqluser/daily_dumps/bin/backup_database.sh </code></pre> <p>please explain what am i missing here.</p>saleemmsmsWed, 29 Feb 2012 02:04:02 -0500http://linuxexchange.org/questions/2792/shell-script-of-mysqldump-works-fine-when-run-manually-but-does-not-run-in-the-cron-jobmysqldumpcrontabCron error mail not giving line numberhttp://linuxexchange.org/questions/2778/cron-error-mail-not-giving-line-number<p>After each run of cron'ed script i get:</p> <p>cp: cannot stat <code>&lt;file&gt;': No such file or directory cp: cannot stat</code>backup.zip': No such file or directory</p> <p>But it does not state what line the cp is issued from. This is not clear as there is allot of variables that is created to determine the files.....</p> <p>thx in advanced</p> <p>ygg</p>yggenTue, 24 Jan 2012 06:47:38 -0500http://linuxexchange.org/questions/2778/cron-error-mail-not-giving-line-numbercrontaberrorTool for tracking user's usage of a Linux systemhttp://linuxexchange.org/questions/827/tool-for-tracking-users-usage-of-a-linux-system<p>I am looking for a tool that monitors my system and informs me when a user logs in... someone attempts to login, etc. I know I can create a cron job to check "who" or "w" every so often but I was wondering if anyone was aware of a more proactive approach and/or tool.</p>AndyThu, 10 Jun 2010 15:10:08 -0400http://linuxexchange.org/questions/827/tool-for-tracking-users-usage-of-a-linux-systemcrontabsystem-administrationI am unable to activate a cronjob at fedora linux.http://linuxexchange.org/questions/299/i-am-unable-to-activate-a-cronjob-at-fedora-linux<p>I am having a simple cron job at my fedora linux i.e. to halt the machine at given time. But my cron job is not getting activated at all. Pl. guide me regarding this. </p> <p>Regards. </p> <p>Milind</p>MilindWed, 05 May 2010 11:24:06 -0400http://linuxexchange.org/questions/299/i-am-unable-to-activate-a-cronjob-at-fedora-linuxcrontabfedoramysqldump to crontabhttp://linuxexchange.org/questions/139/mysqldump-to-crontab<p>I try to set mysqldump to crontab but for some reason it's not working. maybe it's too long? I tried to put it in /etc/crontab and crontab -e mysqldump --default-character-set=utf8... how can i fix that?</p>S2eveTue, 27 Apr 2010 17:53:01 -0400http://linuxexchange.org/questions/139/mysqldump-to-crontabmysqldumpcrontab