cron
cron job not running inside docker container on ubuntu
Install rsyslog inside the container with apt-get install rsyslog and launch it with the command rsyslogd before starting cron with cron -L15 (maximum logging). Then watch the file /var/log/syslog inside the container to see the cron daemon’s own log output. It will tell you if there was a problem parsing your crontab and it will, … Read more
Percent sign % not working in crontab
% is a special character for crontab. From man 5 crontab: 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 a “%” character, will be executed by /bin/sh or by the shell specified in the SHELL variable of … Read more
Using @Scheduled and @EnableScheduling but gives NoSuchBeanDefinitionException
according to exception Info Could not find default TaskScheduler bean, the config should define TaskScheduler rather than “Executor” @Configuration public class AppContext extends WebMvcConfigurationSupport { @Bean public TaskScheduler taskScheduler() { return new ConcurrentTaskScheduler(); } // Of course , you can define the Executor too @Bean public Executor taskExecutor() { return new SimpleAsyncTaskExecutor(); } }
Cron job does NOT get the environment variables set in .bashrc
The reason for source ~/.bashrc not working is the contents on your ~/.bashrc (default one from Ubuntu 12.04). If you look in it you will see on lines 5 and 6 the following: # If not running interactively, don’t do anything [ -z “$PS1” ] && return PS1 variable is set for an interactive shell, … Read more
Cronjob or MySQL event?
I would always go a cron job, because: That’s where sysadmins will expect it to be (this point is not to be underestimated) crontab is bullet-proof, time-tested, extremely widely used and understood You can freely direct/analyse error/success messages where you want Some database tasks require/prefer mysql to be off-line (eg full backup), so you’ve got … Read more
python apscheduler – skipped: maximum number of running instances reached
It means that the task is taking longer than one second and by default only one concurrent execution is allowed for a given job. I cannot tell you how to handle this without knowing what the task is about.
Crontab Not Working with Bash on Ubuntu on Windows
You need to add yourself to the crontab group. usermod -a -G crontab (username) Once you have done this, you also need to make sure that cron is running. Usually this is started with start cron however upstart does not work on WSL from what I can tell, but sudo cron does the job. One … Read more