Tag Info

Hot answers tagged

5

It it perfectly Ok to use MAILTO= per-entry, i.e.: MAILTO="address1" 0 0 * * * /foo/foo.sh MAILTO="address2" 0 2 * * * /foo/foo2.sh MAILTO="address3" 0 4 * * * /foo/foo3.sh MAILTO="address4" 0 6 * * * /foo/foo4.sh 0 8 * * * /foo/foo5.sh 0 10 * * * /foo/foo6.sh And so on. Cheers,


4

midnight is 0 0 * * * /usr/bin/php /www/sites/[domain.com]/files/html/shell/indexer.php reindexall your current crontab runs every full hour. For more info see e.g. this


3

crontab entry for every week (Monday at 3:10 pm): 10 15 * * 1 test -x /path/to/your/weekly/command && /path/to/your/weekly/command and every 3 months, on the 2nd of January, April, July, and October at 1:12 pm: 12 13 2 1,4,7,10 * test -x /path/to/your/quarterly/cmd && /path/to/your/quarterly/cmd This is for a normal user's crontab ...


3

You have one field too many in the crontab line. It should be minute hour dayofmonth month dayofweek command You have an asterisk character in place of the command. Also, if you want a crontab entry to run as root, it's arguably cleaner to put it in a /etc/cron.d/ file than in root's own user-level crontab. Note that system crontabs (i.e. /etc/cron*) ...


3

You need to escape the percent characters using a backslash: .../SK_ITEM_EXTRACT_MFGPRO_$(date +\%m\%d\%y).txt From the crontab(5) man page from the ISC implementation of cron: The ``sixth'' field (the rest of the line) specifies the command to be run. The entire command portion of the line, up to a newline or % character, will be executed by /bin/sh ...


3

Each user has their own scheduled tasks. If you go and pick your kid from school at 4pm every day, your neighbor doesn't also go and pick your kid at 4pm. Cron jobs can be registered by each user (in which case they run with that user's privileges) or at the system level (in which case they run as a user chosen by the system administrator). Each scheduled ...


3

The problem is that cron runs in a text environment. There are a few different approaches for that, depending on what your machine is running. set a display variable: * * * * * DISPLAY=:0.0 /home/my-user-name/Documents/bin/program set up a password-less ssh key-pair and do * * * * * /usr/bin/ssh -y user@localhost ...


2

THe @reboot entry is started when cron is started, but that doesn't mean everything necessary to run your bundle application is up and running. Depending on the setup, e.g. your network might not be up at that time. I would do the following in your case: have the reboot job write a unique file in some known place have a normal cronjob that executes on a ...


2

Most versions of cron run commands using /bin/sh by default, and if the commands run any shell scripts (that don't have a #! line to force use of a specific shell), /bin/sh will be used to run them, too. On some systems, /bin/sh is dash, a shell that doesn't understand the ANSI-C quoting convention used by bash and other shells. So your $'\n' string is ...


2

Perhaps you want to see what's going on and not redirect output to /dev/null. I suggest you open a screen or tmux session. Both are terminal multiplexers, which will stay alive even if you log out. E.g. (..) for info $ screen $(inside screen-t1): ./get_tweets.php .... running first Now press Ctrl-a c to open a new terminal. $(inside screen-t2): ...


1

It seems that your clamscan didn't generate any log file on output. Just change clamscan blah blah >/dev/null 2>/dev/null to clamscan blah blah &>/tmp/scan.log and check the scan.log - there probably some hints.


1

~/.zshenv is loaded by zsh when it starts (except when started with -f or if the configuration directory is changed by setting ZDOTDIR). It is not loaded (cannot be understood) by any other shell. So arranging load ~/.zshenv is equivalent to arranging for your jobs to be executed by zsh. Set the SHELL variable in the crontab; this applies to every job. ...


1

I am not sure if this is what you are looking for. From that answer, I see it as, ORIGMAILTO="$MAILTO" MAILTO=you * * * ... your cron job MAILTO="$ORIGMAILTO"


1

I think the issue is with your if statement. if ! ping -q -w 1 -c 1 $(ip r | grep default | cut -d ' ' -f 3) More specifically: ping -q -w 1 -c 1 $(ip r | grep default | cut -d ' ' -f 3) The host ip isn't passed properly. Note that each portion works by itself (i.e. ping host and ip r....). This has been working for me: $ ip r | grep "default" | cut ...


1

You can simply run a cron by the following tutorial http://findoutanswer.com/48/please-provide-some-linux-cron-job-examples?show=48#q48



Only top voted, non community-wiki answers of a minimum length are eligible