You are not logged in.

#1 2022-05-26 07:42:21

QuickQuokka
Member
Registered: 2022-05-26
Posts: 18

Run command on specific date?

Hello, fellow Arch users!

I want on the 15th of August, 2022, for it to automatically run timedatectl set-timezone Europe/Dublin, as I'm moving to Ireland on that date, and I forget to do stuff, or just put it off.

How do I do this?

Offline

#2 2022-05-26 07:45:27

dogknowsnx
Guest

Re: Run command on specific date?

#3 2022-05-26 11:33:14

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: Run command on specific date?


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#4 2022-05-27 05:07:23

ddeimeke
Member
From: Grüt (Gossau ZH), Switzerland
Registered: 2022-05-20
Posts: 13
Website

Re: Run command on specific date?

QuickQuokka wrote:

I want on the 15th of August, 2022, for it to automatically run timedatectl set-timezone Europe/Dublin, as I'm moving to Ireland on that date, and I forget to do stuff, or just put it off.

For one-time-shots I would prefer at, please don't do cronjobs for that purpose they get repeated (at least once a year).

For your example (all commands as root user):

pacman -S at
systemctl enable --now atd

echo "/usr/bin/timedatectl set-timezone Europe/Dublin" | at "05:00 08152022"

See also: https://linuxhandbook.com/at-command/

Cheers

Dirk

P.S.: I did not find the fitting wiki page in Arch Linux Wiki.

Offline

#5 2022-05-27 06:48:07

dogknowsnx
Guest

Re: Run command on specific date?

ddeimeke wrote:

For one-time-shots I would prefer at, please don't do cronjobs for that purpose they get repeated (at least once a year)

Good point - I call that system maintanance (use a crontab as a monthly reminder smile).

#6 2022-05-27 10:12:35

progandy
Member
Registered: 2012-05-17
Posts: 5,319

Re: Run command on specific date?

If you move regularly without using a vpn, you could also set up a timer that determines the timezone using your ip with e.g. worldtimeapi.org

curl "https://worldtimeapi.org/api/ip" | jq -r .timezone

| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

Board footer

Powered by FluxBB