From cebd9537d0671f6f71371ed1a955f89ec6457c95 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 23 Nov 2018 22:19:08 -0200 Subject: Fetch mail once an hour. Adapt mail.sh to be called on-demand. --- nixos/configuration.nix | 2 +- scripts/mail.sh | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/nixos/configuration.nix b/nixos/configuration.nix index d754f7b6..8db07ea2 100644 --- a/nixos/configuration.nix +++ b/nixos/configuration.nix @@ -298,7 +298,7 @@ services = { cron.enable = true; # We can see the actual generated crontab at /etc/crontab - cron.systemCronJobs = ["* * * * * andreh /home/andreh/annex/dev/code/dotfiles/scripts/mail.sh"]; + cron.systemCronJobs = ["0 * * * * andreh /home/andreh/annex/dev/code/dotfiles/scripts/mail.sh -s"]; xserver = { enable = true; diff --git a/scripts/mail.sh b/scripts/mail.sh index e9f14d88..c8f6522c 100755 --- a/scripts/mail.sh +++ b/scripts/mail.sh @@ -1 +1,5 @@ -mbsync -aV &>> /tmp/mbsync.log && notmuch new &>> /tmp/notmuch.log +if [ "$1" = "-s" ]; then + mbsync -a &>> /tmp/mbsync.log && notmuch new &>> /tmp/notmuch.log +else + mbsync -aV && notmuch new +fi -- cgit v1.3