How do I set up a new cron job? Can I just edit crontab in /etc and add whatever I need (I want to add a weekly job to run the gravity.sh script for pihole)? It seems to work slightly different than in wheezy and before I break anything …
Note that scripts in /etc/cron./ must have alphanumerical (and - _) names, must not have dots (file endings) and must have executable flag. run-parts is quite strict: https://manpages.debian.org/run-parts
Simply creating the folder will not work, You would need to add it as well to your cronatb, similar to what we do in /etc/crontab
Weekly jobs will be executed every week until you removed that job. They are not going to stop automatically after a period of time. Same for monthly or daily job.
You were right! Thanks, what I mean, how does rsnapshot count here? It is the wrong question in the wrong forum! Sorry! If you know the answer, I will appreciate that anyway, if you tell me ;-)…
BTW : Why is ‘crontab -e’ different than opening with ‘vim /etc/crontab’ . I thought this is literally the same command and one is recommended to use ‘crontab -e’?
Not sure what rsnapshot is, but probably it uses Cron for creating snapshots on a regular basis.
/etc/crontab usually contains the jobs to execute the scripts in /etc/cron.daily etc directories (as root user) while crontab -e allows you to create custom cron jobs (hence one can bypassing the script’s shell process) as user you are executing crontab with, so that it is necessary for jobs your want to run as non-root user, recommended for security reasons whenever you do not require root permissions. Also /etc/cron.d/ can be used for custom root user cron jobs which is hence pretty similar to sudo crontab -e.