aboutsummaryrefslogtreecommitdiff
path: root/README.markdown
blob: 4ba51ac9b4eae85cce2aa409ee2d28951c2568cf (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
Croncrypt
=========

Wrapper to sign and encrypt `cron(8)` output and errors with PGP/MIME before
sending them to the `MAILTO` destination.

    $ crontab -l
    CRONCRYPT_KEYID=0x0A1B2C3D4E5F6G7H
    CRONCRYPT_PASSPHRASE=hibbityboo
    MAILTO=me@mynet

    0 1 * * *  croncrypt rsync /home/tom/important-file /home/backups

The main design goal is simplicity; just whack `croncrypt` in front of all your
`crontab(5)` entries, provided they don’t use pipes or `stderr`/`stdout`
redirects, in which case you should consider putting it all into a script file
anyway.

As an alternative, to apply this to all of the tasks in that `crontab(5)` file,
you can specify `SHELL` with a fully-qualified path to the `croncryptsh`
executable:

    $ crontab -l
    CRONCRYPT_KEYID=0x0A1B2C3D4E5F6G7H
    CRONCRYPT_PASSPHRASE=hibbityboo
    MAILTO=me@mynet
    SHELL=$HOME/.local/bin/croncryptsh

    0 1 * * *  rsync /home/tom/important-file-1 /home/backups
    0 2 * * *  rsync /home/tom/important-file-2 /home/backups

This is the method the author prefers.

Don’t use your own GPG key for signing! I recommend you create a dedicated key
just for Croncrypt, and sign it locally with `gpg --lsign` so that your
software trusts it locally.

Installation
------------

Put the `croncrypt` binary somewhere in your `crontab`’s `PATH`, and install
the following Perl modules:

*   `Carp`
*   `IPC::Run3`
*   `Mail::GnuPG`
*   `MIME::Entity`

On Debian-derived systems, this should do the trick:

    # aptitude install perl-base perl-modules libmail-gnupg-perl \
        libmime-tools-perl libipc-run3-perl

License
-------

Copyright (c) [Tom Ryder][1]. Distributed under [Artistic License 2.0][2].

[1]: https://sanctum.geek.nz/
[2]: http://opensource.org/licenses/artistic-license-2.0