For the lack of thinking this through (and dealing with Luks volumes all day) What would an efficient entry be to execute a command on the 1st Saturday of the month look like in a crontab file?
This is a bit over my head as I’m not a great scripter and I appear to be getting more advanced when using crons, so it seems.
Habit mainly. I have a bunch of maintenance scripts that I have used and developed over the past few years.
I’m always open for new and better ways of doing things.
I like what chroot mentioned but I’m unsure if I have the ability to actually pinpoint a time when I want things to start. As I understand it (at least at one point) using /etc/cron.daily runs things that day but not at specific times.
I opted for the --user space to run this.
The jist of the timer, is that I have this set to run/update every 6 hours.
You enable/start it as you would any other service.
Check out the following links as it’s pretty much to the point.
The second link focuses on Oncalendar - this is key if you want cron-type functionality.
Thanks @altman !
I’m far from being an expert in this feature but this worked for me. Now I just need to figure out how to send the completed task, an email
Ah ha! Caveat with using systemd, there isn’t a mailto feature. That’s Ok, I can add this to the script I’m calling:
ExecStart=/bin/bash -lc "echo \"$(whoami) created this message on $(date) to remind you about...\" | mutt -s \"Don't forget...\" you@domain.com"
Well, it needs to be modded a bit but I did run a modded version on the cli and it works perfectly!!
So ideally, it would be ran after a scheduled task completes and of course, I would need to pipe the output of the task (for example, running a backup that captures backed up file) and attach that to the email.
lol. - this gets complex.
I’m changing the topic to something like, using systemd instead of crontab.