I am new to Linux and its commands and I am trying to learn cron jobs. So, I created a cronjob that runs every minute.
* * * * * /home/vscoder/script.sh >> /var/log/cronjob.log 2>&1
I know that by default in Ubuntu cron job logs are stored in /var/log/syslog file but I am trying to save logs for my cron job in /var/log/cronjob.log file. But my cron logs are not stored in it, cronjob.log file is empty. Please refer below:
vscoder@vscoder-VirtualBox:/var/log$ cat cronjob.log
vscoder@vscoder-VirtualBox:/var/log$
What should I do so that my cron job logs will be stored in /var/log/cronjob.log file.
/var/log/cronjob.log
writable by the user? You might want to choose a different location. – Toby Speight Jun 25 '21 at 20:25