Is there a log of crontab for me to know if crontab is working fine? I am on Linux Mint 17.3.What I have done:ran crontab -e as rootit did not exist, so I chose nano editor and proceededentered this line 00 12 * * * /home/vlastimil/Development/bash/full-upgrade.shsaved and exitedMy goal is to automate updates every single day at 12 hours (midday, not midnight). This thread is not about arguing the best way to achieve that.I created /home/vlastimil/Development/bash/full-upgrade.sh file with content:#!/bin/bashapt-get update && apt-get dist-upgrade -y && apt-get --purge autoremove -yAnd finally I have set 755 rights to the file.I don't know how to test it. Will it work?
How do I know if crontab is working fine?
linux;cron
Logs probably go to syslog, which varies depending on what syslog daemon is involved and how that is configured to log, start withgrep -r cron /etc/*syslog*to find where and what is going on on the system, or per derobert under systemd the relevant command isjournalctl -b 0 _SYSTEMD_UNIT=cron.serviceAdding a test cron job that touches a file (ideally not in /tmp, unless the vendor makes that per-user private, for security reasons) should also confirm whether cron is working or not, just be sure to eventually remove the test cron job before it fills up a partition or something silly.Other usability and security pointers: some cron daemons can run scripts directly, in which case you can just copy the script into /etc/cron.daily, though this may not suit something that you do not want to run (with everything else!) at exactly the top of the hour. root running a script under a user's home directory could be very bad, as a compromise of that user account could then be leveraged to root access, or the script could needlessly fail if the home directory is on NFS or encrypted; move the script elsewhere to avoid this (/root/bin, or somewhere under /usr/local or /opt depending on the local filesystem preferences).Even more pointers fall into the realm of shell script debugging, mostly to note that cron is not the shell; use env or set to see what is set under cron, check that PATH is correct, and etc. (One old and horrible linux kernel bug involved java daemons crashing but only if they were run from cron; that was fun to debug...)