Tag Info

New answers tagged

1

OK, you already have part of an answer, having found the permissions on /usr/bin/crontab. Now chmod is saying it can't modify those permissions. Try lsattr /usr/bin/crontab to check if the file attributes have been messed with, and chattr -i /usr/bin/crontab to fix it if that is indeed the issue. If this is foul play, then my guess is someone is trying to ...


0

Bash is telling you that you don't have execute permissions on the /usr/bin/crontab binary. It should match the following permissions # ls -la /usr/bin/crontab -rwxr-sr-x 1 root crontab 35880 Jul 4 2012 /usr/bin/crontab You can probably fix this by running, as root chmod 2755 /usr/bin/crontab Or you could run the following to force a complete ...


0

Try chmod 0755 /usr/bin/crontab and then execute crontab binary again. Perhaps someone or something has changed the permissions for the executable itself. EDIT: After your update it seems that your root file system has gone read-only for some reason. That is my guess, anyway. The reasons for that could be Your system has suffered some kind of hardware ...


0

Hi I see that this question has been visited several times. Because at time of writing there is no answer elsewhere on the internet I had better write up the workaround which I have adopted so far. My workaround has been tested by me under Cygwin 1.7.32 / cron 5. The problem is that the operation of the cronevents call in Cygwin appears to be ...


0

You might try this instead. fping -t300 -a $1.{21..30} | while read online_ip; do echo snmpwalk -v 2c -c public $online_ip iso.3.6.1.2.1.17.4.3.1; snmpwalk -v 2c -c public $online_ip iso.3.6.1.2.1.17.4.3.1; done This will do the same thing, but instead of piping the output of fping to a file, you can simply pipe that output into a while loop.


1

/etc/crontab is the system-wide crontab. I'm guessing that "STAT FAILED" error means that your cron daemon expects this file to exist. You have stated that this file does not exist on your system; therefore, calls to stat() fail. Simply touching this file should clear up this error. sudo touch /etc/crontab


0

Have a look in your logs in /var/log. If you grep them for CRON you should find messages from it, it normally logs successes and failures. grep CRON /var/log/* At a guess I'd ask whether your crontab file has a newline at the end. Without one the whole file normally fails. cron requires that each entry in a crontab end in a newline character. If ...


0

When you run a job from crontab, your $HOME environment variable is: / The Amazon client looks for either ~/.aws/config or ~/.aws/credentials If $HOME = /, then the client won't find those files To make it work, update your script so that it exports an actual home directory for $HOME export HOME=/root and then put a config or credentials files in ...


5

Looks like monit is monitoring your crond and restarts it if it doesn't find it. You should be able to stop crond using monit stop crond.


2

What you might be able to do in your case is to change your backup script so that the line: umask 022 appears near the top BEFORE any file is created. This will generate files with a default permissions of 755 or 644 (depending if it is a file or directory). However, this default can be overridden by any of the applications running within the script.


1

It turned out the be SElinux problem. audit2allow -a returns: #============= antivirus_t ============== #!!!! This avc can be allowed using the boolean 'antivirus_can_scan_system' allow antivirus_t home_root_t:dir read; And solved by entering: setsebool -P antivirus_can_scan_system 1


0

Apart from your script being pretty much broken, I suggest you write something as the following. Don't use capitalized variable names. Only environment variables are capitalized by convention. Don't use absolute paths for binaries like find, mail etc. #!/usr/bin/bash # Create Hourly Cron Job With Clamscan # Directories to scan ...


0

In my limited testing, setting the shell to /bin/false works. You will still see /opt/job.sh executing in your logs, but it will be a noop: SHELL=/bin/false */1 * * * * root /some/job.sh


2

I recommend to use a process manager to do your job. Luckily you have the best process manager ever on board, systemd. In my eyes it is about semantics, even if both solutions are working for your case. Use timer units for cron-like schedules you are talking about. Use restart statements to specify a restart policy of a task that ends unexpected. That ...


1

Tripwire has an option to suppress reports that have no errors (MAILNOVIOLATIONS), it is found in the config file... You could set up 2 different twcfg files, one with MAILNOVIOLATIONS set to TRUE, and one with this option set to FALSE MAILNOVIOLATIONS =true (or false) Then your cronjob could run tripwire using the -c flag to select the twcfg file ...


2

Sounds like a job for monit which is designed to do what you describe in option 2


1

This is pretty clearly a bug, and it seems to affect Red Hat systems of a number of flavours. I've confirmed the behaviour you describe on CentOS 5, C6, Fedora 19, and Fedora 20. For crontab entries of the form 30 a-b/c * * * /bin/ls it seems that if there exists no positive integer n for which a+nc is in the range [24,b], the invalidity check for the ...


3

0 8 * * 6 test $(($(date +\%W)\%2)) -eq 1 && yourCommand date +%W: week number of year with Monday as first day of week, today week 39 $((39%2)): modulo operation: result is 0 (even week number) or 1 (odd week number), this week result is 1, next week 0 test 1 -eq 1: arithmetic test (equal), in this case result is boolean true && ...


1

What you've shown is "every week". Then the code is: 0 8 * * 6 Are you sure you need to run it every two weeks? 0 8 * * 6 expr `date +\%s` / 604800 \% 2 >/dev/null || yourCommand


1

Replace 24 with 0 (which is 24), as for second entry, last job would run 21:30. You can also try this: 30 0,6,9,12,15,18,21 * * * /path/to/script full syntax: # cat /etc/crontab SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin MAILTO=root HOME=/ # For details see man 4 crontabs # Example of job definition: # .---------------- minute (0 - 59) # | ...


3

According to the man page for cron(8) (the daemon that actually sends the message): -m This option allows you to specify a shell command string to use for sending cron mail output instead of sendmail(8). This command must accept a fully formatted mail message (with headers) on stdin and send it as a mail message to ...


1

A quick Google shows me that /etc/sysconfig/crond is the file that defines what mailer is used by cron.


0

Look in the folder /etc/logrotate.d/there are some file for the logrotation. I think there is a logrotate file for postgres. I think you can delete that file. Otherwise check the other files if you can find some other rules.



Top 50 recent answers are included