Tag Info

New answers tagged

0

IMHO this line will run each working day: */10 6-17 29-31 1,4,7,10 1-5 php script.php The reason is days of week are related to rest of the definitions (minutes, hours, days, months) with function OR. The definitions minutes, hours, days, months are binded by AND funtion P.S. So my proposal is to incorporate this login in the script itself


0

add to your crontab line : &>/tmp/myscript.log for example : 0 12 * * 1 /absolute/path/to/myscript.sh &>/tmp/myscript.log and wait for the script to executes and check the myscript log, I assume that the possible errors will be " git command not found " or " cd command not found" , if that was the case then you have to locate the full path of ...


1

In ~/.vimrc add: autocmd filetype crontab setlocal nobackup nowritebackup


0

Crontab is not smart enough to keep your server up. When it goes down, it has to wait till crontab runs again; your clients will get a 404 error from your faulty server. I advise you to use something like Supervisor. You can install it using easy_install like easy_install supervisor You will need to deal with Supervisord and Supervisorctl. The first ...


1

First thing you should do is not using the harddisk at all. Do not boot, do not use the harddisk! Put it into an external case or another computer. Bootup some other Linux and try to recoover the files. I have never tried to undelete files on Linux, but you could try http://extundelete.sourceforge.net/ or google another solution. But the crucial part is (and ...


0

The cron looks fine to me. Try this command on your crontab file that contains the command to show any unwanted characters: cat -v


-1

At least on Yosemite, cron logs output as mail messages, so use the mail to read them.


-1

Just restart cron, it will use your local timezone setting. It worked for me. sudo /etc/init.d/cron restart


0

The most simple way is capture print errors and savem then in a file. I have a cronjob that call a php command line, like this: 1 0 * * * php /pathOfMyApp/index.php controllerName functionName > /pathOfMyApp/log/myErrorLog 2>&1 The part before '>' it's my cronjob and after '>' it's the capture and save in a file located in a log folder in the root of ...


0

LaunchControl made it painless for me in Yosemite. It has a nice drag-n-drop GUI to help you create or edit services. It was surprising to see all the services running that I did not know about. Steps Start LaunchControl Top-left change to GlobalDeamons and enter your admin password File->New Under label, give it a unique name. Convention is ...


0

Every script placed in folder /etc/cron.hourly would run on hourly basis. However your files needs to be: executable, match the Debian cron script namespace (^[a-zA-Z0-9_-]+$). So for example if you've script with extension (.sh in this case), it won't work. To print the names of the scripts which would be run, try: sudo run-parts --report --test ...


0

each test.sh called by cron is a new process, so environnement variable are dropped. Try # test.sh JOB_COUNTER=$(< $HOME/jobcounter.txt ) JOB_COUNTER=$((JOB_COUNTER + 1)) echo $JOB_COUNTER > $HOME/jobcounter.txt echo $JOB_COUNTER # JOB_COUNTER can be used here beware that you cannot use JOB_COUNTER in calling shell unless test.sh is sourced ( . ...



Top 50 recent answers are included