From c51c81ab52ef714eacde56ae430df24d072ef98a Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Tue, 11 Apr 2023 14:40:50 +0200 Subject: [PATCH 1/2] update gpg.md --- data/gpg.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/gpg.md b/data/gpg.md index 5b093fb..9d2af5d 100644 --- a/data/gpg.md +++ b/data/gpg.md @@ -46,7 +46,7 @@ Get the message back out the file with: Search for a key at any key store: -> gpg --keyserver *sks.hklbgd.org* --search-keys nestorv +> gpg --search-keys nestorv Once you've made a decision about someone: @@ -75,11 +75,11 @@ Once you're in the interface, type `trust`. Then send those trusted keys up to a server, so people can see you have verified them: -> gpg --keyserver *sks.hklbgd.org* --send-keys *024C6B1C84449BD1CB4DF7A152295D2377F4D70F* +> gpg --send-keys *024C6B1C84449BD1CB4DF7A152295D2377F4D70F* # Refresh Keys -> gpg --keyserver *sks.hklbgd.org* --refresh-keys +> gpg --refresh-keys # Export From 03a57e43f67221e5233fd585628b076d181a04f6 Mon Sep 17 00:00:00 2001 From: Malin Freeborn Date: Thu, 13 Apr 2023 06:06:54 +0200 Subject: [PATCH 2/2] embiggen time tools --- basics/at.md | 12 ++++++++++++ basics/cron.md | 10 ++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/basics/at.md b/basics/at.md index 901d3dc..5738744 100644 --- a/basics/at.md +++ b/basics/at.md @@ -43,3 +43,15 @@ This will print all pending IDs. Remove a job by the ID with: > atrm 2 Check /var/spool/atd/ + +## Automation + +Automatically add a job for later, by setting the date, then using echo for the command. + +> t="$(date -d "2 minutes" +%R)" + +> echo "fortune > ~/file" | at "$t" + +> watch cat file + +The `$t` here outputs the day in minutes, but you could also do `t="$(date -d "2 days" +%m/%d/%Y)"`. diff --git a/basics/cron.md b/basics/cron.md index 34452b3..7f3bbc5 100644 --- a/basics/cron.md +++ b/basics/cron.md @@ -91,7 +91,11 @@ If you're using vim as the editor, just run this at the top of your crontab: > :r!echo PATH=$PATH -### Location +### `date` Commands + +Cron doesn't understand the `%` sign, so if you want to use `date +%R`, then it should be escaped with a backslash: `date +\%R`. + +### File Location The crontab files are in `/var/spool/cron/`, so you can backup or restore them. @@ -101,7 +105,7 @@ The crontab files are in `/var/spool/cron/`, so you can backup or restore them. HOME=/home/user PATH=/usr/condabin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/user/.local/bin:/home/user/.scripts/:/home/user/.local/bin:/home/user/.scripts/ -1 0 1 * * /usr/bin/mkdir -p $HOME/arc/$(date +%Y/%m) +1 0 1 * * /usr/bin/mkdir -p $HOME/arc/$(date +\%Y/\%m) 18 0 1 */3 * $HOME/.scripts/mail-clean.sh @@ -110,3 +114,5 @@ PATH=/usr/condabin:/usr/local/sbin:/usr/local/bin:/usr/bin:/usr/bin/site_perl:/u 50 18 * * * /usr/bin/timeout 30m /usr/bin/syncthing ``` + +