Great examples.
Always use full paths in cron!
Printable View
Great examples.
Always use full paths in cron!
Hi,
I use a really cool program called autokey-gtk the only problem is that over time it takes more and more ram. I found that quitting the program and restarting it will keep the program from becoming so bloated that it no longer functions.
I'd really like to be able to automatically have the program launch then 58 minutes later automatically quit and then after one minute relaunch.
I'm not sure how to do this. I tried adding 01 * * * * autokey-gtk via crontab -e to see if I could get the program to launch. It didn't work.
I'd appreciate any help.
Thank you.
Hello all, i`m new with Ubuntu and i like it but i`m having trouble installing a cronjob i vahe try`d but it not working like i want to so i figure i miss spelled something in the command
i did crontab -e ( unde root username )
added this line there
From what i`v read in this topic this line should run ./stats.pl and add a line in mybackup.log every 59 minutes.Code:59 * * * * cd /home/PATCH TO FILE/psychostats3.1 && ./stats.pl && echo "Stats update: $(date)" >> /tmp/mybackup.log
If there is something wrong there please someone help me figure this out .
ps : sry for bad language.
Nvm : working as intended :D thx too
Thanks for this really useful HowTo. Could you please also tell us how to execute cronjobs requires authentication (like syncing a folder with a remote server over ssh)
Oh thanks, that comes pretty handy to me :) just one question, does it start at 00 by default or is that something one can specify?
I tried searching on this thread for my problem but could not find anything.
I have a QNAP TS259 with the most recent firmware. I log in as admin and then edit the admin crontab file to add two lines to run backup scipts. These were added the end of last week, and then today I saw that these entries were gone. I verified mid week they were there.
It's as if the admin crontab file is being over written every so often.
Is there a way to make the crontab changes stick.
Hi all,
I'm trying to simplify my crontab entries. I currently have them like:
and these work just fine. However, I'd like to replace the redirects with variants of the actual script name - something like:Code:1 1 * * * root /scripts/test.sh >>/scripts/test.sh.log 2>>/scripts/test.sh.err
The only format I've found for use of the & in crontab entries is like:Code:1 1 * * * root /scripts/test.sh >>&0.log 2>>&0.err
Note: The redirects need to be appendable (i.e. I must be able to use >> instead of > )Code:1 1 * * * root /scripts/test.sh >/scripts/test.sh.log 2>&1
Is this possible?
Thanks for any and all suggestions/help.
Dirk
I wasn't familiar with what the 2>&1 was actually doing. Found some good info on it.
http://stackoverflow.com/questions/8...ell-what-is-21
I found some other info on accessing the name of the script that's running (in bash, this would be $0). So, my next attempt looked like:
It does produce a file; unfortunately, it's named .log and it winds up in the root user's directory.Code:1 1 * * * root /scripts/test >>$0.log 2>&1
So, I renamed test.sh to test2.sh, and created /scripts/test.sh which contains:
which is invoked by the crontab entry:Code:#!/bin/bash
/scripts/test2.sh >>$0.log 2>>%0.err
Log is now written to /scripts/test.sh.log and errors to /scripts/test.sh.err. Bit of a hack, but yea! :DCode:1 1 * * * root /scripts/test.sh >/dev/null 2>&1
Dirk
Hi, can someone please help or redirect me?
I am running kubuntu 12.04I have scheduled tasks in System Settings - Task Scheduler.
Now, some of these tasks do run properly, others don't. When I type crontab -l I can see the tasks set in the task scheduler, but if I opne etc/crontab with Kate, for instance, I see only a few root commands.
When one of those tasks is not run, I see in syslog the line:
(root) CMD (if [ -x /usr/bin/gsmsmsrequeue ]; then /usr/bin/gsmsmsrequeue; fi)
My questions are:
1. What file is crontab -l reading?
2. Why some tasks do run and others don't?
3. Where should I place the MAILTO= to have emails from cron sent to my email?
4. What is gsmsmsrequeue and what is it doing here?
Thank you