Cron Job fails with Error Message “(getpwnam() failed): No such file or directory”

On a CentOS server, cronjob did not work. Checking the log file found the following error message in /var/log/cron Oct 24 18:35:01 CentOS-75-64-minimal crond[1546]: (/usr/local/bin/monitor-mysql) ERROR (getpwnam() failed) The error was because no user was specified in the cronjob. When you use cronjob in file /etc/crontab, you need to specify the username before the command … Read more

Set vim as default cronjob editor

Method 1 vi /etc/bashrc Find export EDITOR=”pico” export VISUAL=”pico” Replace with export EDITOR=”vi” export VISUAL=”vi” Method 2 edit .bash_profile vi /root/.bash_profile Add export VISUAL=vi Once added, .bash_profile will look like root@server54 [~]# cat .bash_profile # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment … Read more

cronjob

crontab Start a program after reboot using cronjob Running wp-cron with cronjob Cronjob for Magento 1.9 set vi as default cronjob editor Cron Job fails with Error Message “(getpwnam() failed): No such file or directory” Cronjob Timing * * * * * = every minute */5 * * * * = every 5 minute 0 … Read more