Tag Info

Hot answers tagged

6

The commands are being run independently, so it is not the same as expecting them to run in the same shell/environment. You would probably be better served by creating a shell script that performs the desired commands and then calling the script from the crontab. Update: The above was a guess, and/or proposed possibilty (as a comment so tersely and ...


6

There are caveats to pay attention to. Since the question doesn't specify an exact OS (but implies it is some Unix like OS), the list of caveats will depend on specific OS and version. The most important to keep in mind are: nice is intended to affect how much CPU time is given to a process, but not how much RAM or I/O capacity. Thus instead of the intended ...


5

It appears that some checks that weren't supposed to be released into all update streams have been. See eg http://unix.stackexchange.com/questions/183763/spamassassin-object-method-location-problems-after-restart for more details, but that the upshot is that the errors should go away following the next update after the errant rule(s) have been pulled. ...


4

I'd take a different approach... No, I wouldn't mess around with nice for this. And gzip isn't that great. Plus, you're using gzip -9 which gives the greatest compression rates at the expense of CPU. Do you really need that level of compression over the default (level 6)? Does your system get strained as much if you don't use gzip level 9? What are the ...


3

The following should work: 58 12 * * * (cd /home/joe/dev; echo `pwd` | logger) By wrapping the commands in parentheses, you should force them all to run in the same subshell.


3

As per this Unix&Linux SE answer, you can replace ; with && as different versions of cron across different Linux distributions handle this type of functionality in different ways: cd /home/joe/dev && echo `pwd` | logger


2

In addition to the ampersand that was already mentioned, you also have to be careful with a % character in a cron entry. % in a cron entry will be interpreted as a line break and has to be escaped with a backslash(\%). Make sure the import_key that you censored doesn't have such a character. Also, URLs often have % in them to escape certain characters like ...


2

The ampersand character (&) actually means something in Linux (well, in a Bourne-compatible shell). It means: run the command as a background task. Because of that, you are actually telling cron to run /usr/bin/wget -O /dev/null http://domain.nl/wp-cron.php?import_key=XXXXXXXXXX in the background, and then to do action=processing. And that's what cron ...


2

If the script is running in root's crontab, you should remove 'sudo' from the command. I've seen this before, where trying to 'sudo' when you're already root makes the command fail. If you want to switch user, then the command when run as root, is 'su -l jira', not sudo -u jira.


1

You should not rely on MySQL client to pick up the appropriate MySQL configuration file because of the cascading nature of how the client is reading those files. Instead you should put both your my.cnf and test_mysql.sh inside /home/tmp and use --defaults-extra-file [link] parameter in your script. Do take note, the --defaults-extra-file needs to be the ...


1

The % in your crontab file gets turned into a newline character unless escaped with a backslash. Try grep `date +\%Y-\%m-\%d` /var/wwww/file/file.log >> /home/filename/file.log see man 5 crontab for details.


1

Use tools like strace, ltrace to see what a particular hanged script process is doing. Also lsof if it's stuck doing something on a fd (like a blocking select).


1

I think the nearest one should be: * * * * * /usr/local/php -q /home/user_name/public_html/run.php Notes: All need absolute path You need to find your php's absolute path by command which php. Mine is /usr/bin/php You need to make sure you are editing the same user's crontab with crontab -e, and the same user can do a cat ...



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