Sent from ProtonMail, encrypted email based in Switzerland. ------- Original Message ------- On Thursday, April 7th, 2022 at 3:04 PM, Mike Wright <nobody@xxxxxxxxxxxxxxxxxxxx> wrote: > On 4/7/22 11:53, olivares33561 via users wrote: > > > Sent from ProtonMail, encrypted email based in Switzerland. > > > > ------- Original Message ------- > > On Wednesday, April 6th, 2022 at 8:09 PM, Tim via users users@xxxxxxxxxxxxxxxxxxxxxxx wrote: > > > > > On Tue, 2022-04-05 at 20:18 +0000, olivares33561 via users wrote: > > > > > > > How can I convert a crontab > > > > # > > > > [olivares@fedora Downloads]$ crontab -l > > > > # min hour day-of-month month day-of-week command > > > > # 0-59 0-23 1-31 1-12 0-6 0=sun 1=mon > > > > #50 04 * * 1-5 ~/.xalarm >/dev/null 2>&1 > > > > #50 04 * * 0,6 ~/.salarm >/dev/null 2>&1 > > > > #59 09 * * 0,6 ~/.salarm >/dev/null 2>&1 > > > > #00 07 * * 1-5 ~/.xalarm >/dev/null 2>&1 > > > > 42 08 * * 1-5 ~/.dalarm >/dev/null 2>&1 > > > > 52 09 * * 1-5 ~/.dalarm >/dev/null 2>&1 > > > > 40 10 * * 1-5 ~/.dalarm >/dev/null 2>&1 > > > > 28 11 * * 1-5 ~/.dalarm >/dev/null 2>&1 > > > > 16 12 * * 1-5 ~/.dalarm >/dev/null 2>&1 > > > > 57 12 * * 1-5 ~/.dalarm >/dev/null 2>&1 > > > > 40 14 * * 1-5 ~/.dalarm >/dev/null 2>&1 > > > > 28 15 * * 1-5 ~/.dalarm >/dev/null 2>&1 > > > > 17 16 * * 1-5 ~/.dalarm >/dev/null 2>&1 > > > > #30 16 * * 1-5 ~/.lalarm > /dev/null 2>&1 > > > > 25 16 * * 1-5 /usr/sbin/poweroff >/dev/null 2>&1 > > > > > > > > # > > > > to systemd timers? An easy idiot proof way. The .dalarm script > > > > calls mplayer and plays from a playlist. > > > > > > Tangentially, can you get mplayer to make sounds when it's not you > > > that runs it? i.e. A system user rather than a real user. > > > > > > > I have read https://opensource.com/article/20/7/systemd-timers > > > > and https://www.maketecheasier.com/use-systemd-timers-as-cron-replacement/ > > > > > > > > but have not tried it out. Any help on this is appreciated. > > > > > > You could look at this, too: > > > https://wiki.archlinux.org/title/Systemd/Timers > > > Archlinux docs often get good recommendations > > > > > > NB: I've only just looked at this just now, I've only ever done the > > > odd crontab thing a few times. Each time I have to work it out. > > > > > > -- > > > > > > uname -rsvp > > > Linux 3.10.0-1160.59.1.el7.x86_64 #1 SMP Wed Feb 23 16:47:03 UTC 2022 x86_64 > > > > > > Boilerplate: All unexpected mail to my mailbox is automatically deleted. > > > I will only get to see the messages that are posted to the mailing list. > > > > Thanks to all who have responded. I am trying it out, but I have it not working. I created a poweroff.service and poweroff.timer. > > > > [olivares@fedora ~]$ cat /etc/systemd/system/poweroff.service > > # /etc/systemd/system/poweroff.service > > [Unit] > > Description = Poweroff maschine at 16:20 PM Mo-Fri > > > > [Service] > > Type=oneshot > > ExecStart=sudo systemctl poweroff > > [olivares@fedora ~]$ cat /etc/systemd/system/poweroff. > > poweroff.service poweroff.timer > > [olivares@fedora ~]$ cat /etc/systemd/system/poweroff.timer > > # /etc/systemd/system/poweroff.timer > > [Unit] > > Description=Poweroff maschine at 4:20 PM Mo-Fri > > > > [Timer] > > OnCalendar=Mon..Fri --* 16:20:00 > > Persistent=true > > > > [Install] > > WantedBy=timers.target > > [olivares@fedora ~]$ > > > > and I test it and it did not work. (tested shutdown at 8:20 AM, have changed it to 16:20:00 which is 4:20 pm) What do I need to add? > > I had /usr/sbin/poweroff in a crontab, and it too failed. I get the following messages for attempting to debug. > > </snip> > > > > 1) systemctl requires a command such as "start" > 2) the poweroff.service is calling itself in the ExecStart line. > 3) I think sudo shouldn't be necessary since poweroff.service is defined > as a system service which already runs as root. > 4) there is already a poweroff.target; I don't know if that presents a > problem/conflict. > 5) you might try "/sbin/poweroff -p" as the ExecStart argument > > Looks like you're on the right path. Good luck! > _______________________________________________ I am getting closer. [olivares@fedora user]$ cat poweroff.service # /etc/systemd/system/poweroff.service [Unit] Description = Poweroff machine at 16:20 PM Mo-Fri [Service] Type=oneshot #ExecStart=~/bin/poweroff.sh ExecStart=/usr/bin/sudo /usr/bin/systemctl --no-block poweroff.service [olivares@fedora user]$ cat poweroff.timer # /etc/systemd/system/poweroff.timer [Unit] Description=Poweroff machine at 4:20 PM Mo-Fri [Timer] OnCalendar=Mon..Fri *-*-* 16:20:00 Persistent=true [Install] WantedBy=timers.target I get the following error message: [olivares@fedora user]$ systemctl --user enable poweroff.service The unit files have no installation config (WantedBy=, RequiredBy=, Also=, Alias= settings in the [Install] section, and DefaultInstance= for template units). This means they are not meant to be enabled using systemctl. Possible reasons for having this kind of units are: • A unit may be statically enabled by being symlinked from another unit's .wants/ or .requires/ directory. • A unit's purpose may be to act as a helper for some other unit which has a requirement dependency on it. • A unit may be started when needed via activation (socket, path, timer, D-Bus, udev, scripted systemctl call, ...). • In case of template units, the unit is meant to be enabled with some instance name specified. [olivares@fedora user]$ Thank you all for helping me. Best Regards, Antonio _______________________________________________ users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx Fedora Code of Conduct: https://docs.fedoraproject.org/en-US/project/code-of-conduct/ List Guidelines: https://fedoraproject.org/wiki/Mailing_list_guidelines List Archives: https://lists.fedoraproject.org/archives/list/users@xxxxxxxxxxxxxxxxxxxxxxx Do not reply to spam on the list, report it: https://pagure.io/fedora-infrastructure