Tag Info

New answers tagged

0

I get the feeling that you're trying to use cron as a process supervisor. (@reboot is once while * * * * * is every minute). Better idea 1: Use systemd (I think that what's EL 7 systems are using, I've yet to really play with it myself). Better idea 2: Have a init-script that starts the service and manages a lock file (/var/log/subsys/SERVICE would be ...


0

Yes, it is possible (and very probable). A crude solution is to instruct your script to sleep some time. For example, change your cron line as below: * * * * * sleep 60; python script.py This will wait 60 seconds, which should give MySQL time to start. If you had to be absolutely sure that mysql process started before your script runs, you can write a ...


0

Yes, this is absolutely possible. Cron is an important service on every system and will likely start before something like MySQL. While it might be possible to alter the order, this has the potential to screw up your system if you are not extra careful. A better alternative would be to just add a delay to your cron script so it waits long enough that MySQL ...


0

Yes, the cron daemon could quite easily startup before mysql has completed (or even begun) its startup process.


8

In order to set the desired environment variables you need to source the .bash_profile file with . /home/some_user/.bash_profile. In your case, you are executing the bash_profile file, which will basically execute that file and exit the shell. The next time some_script is run it will start with fresh environment variables. Check this link - sourcing vs ...


0

If you was changed timezone on server, you must restart cron daemon. Maybe runnning anacron? https://en.wikipedia.org/wiki/Anacron


0

In Suse Linux distros is like this: cat /var/lib/logrotate.status


0

You can use -a switch in order to specify additional headers. And an additional header can be From, so it's just what you need. Example: /some_command.sh | mail -s "Email subject" -a "From:Sender Name <sender@email.com>" recipient@email.com


0

A regular system-wide crontab is a specific user's crontab and it has the username field, as used by /etc/crontab. Using scripts in /etc/cron.* (hourly, daily, weekly, monthly) is a cleaner and easier way (prevents common syntax errors) of configuring crontab for root user and this is handled by run-parts which run scripts or programs in a directory. All ...


1

Cronjob for both log & email : Run once a month at midnight of the first day of the month: 0 0 1 * * 0 0 1 * * /home/User/script.sh > /home/User/cronlog/`date +\%Y-\%m-\%d-\%H:\%M:\%S`-cron.log 2>&1 ; mailx -s "CronJob is run successfully" someone@domain.com,someone1@domain.com


0

It may be in /etc/cron.daily (I assume it runs as root). Those jobs are not visible in crontab -l but still executed.


0

I know this is 5 years old, but for anyone stumbling across this having the same problem (as I had) here is my solution: I checked every users crontab with sudo crontab -e -u username Where "username" should be an existing username like "www-data" (which was the culprit in my case). Hope this helps someone.


2

incrond (inotify cron daemon) behaves like cron but uses inotify as the triggering mechanism. This guide has some pretty comprehensive examples. An example incron entry for the case you described might be: /path/to/file IN_CLOSE_WRITE /path/to/your_script


0

If you are running Linux, as I assume you are, then you can rely on Linux inotify mechanism that notifies user-space processes when files change. LSyncd is one program built around that feature, which you can configure to execute arbitrary commands when files change.


0

I don't have a C7 system to hand but on Fedora the cron daemon is called crond and lives in /usr/sbin. Perhaps you can figure it out from that. (it's easy)



Top 50 recent answers are included