$ uname -a
FreeBSD firminmaillard 12.2-RELEASE-p1 FreeBSD 12.2-RELEASE-p1 GENERIC amd64
$ whoami
freebsd
$ cat /etc/cron
/etc/cron.d/ /etc/crontab
$ cat /etc/crontab
# /etc/crontab - root's crontab for FreeBSD
#
# $FreeBSD: releng/12.2/usr.sbin/cron/cron/crontab 338497 2018-09-06 14:55:54Z brd $
#
SHELL=/bin/sh
PATH=/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
#
#minute hour mday month wday who command
#
# Save some entropy so that /dev/random can re-seed on boot.
*/11 * * * * operator /usr/libexec/save-entropy
#
# Rotate log files every hour, if necessary.
0 * * * * root newsyslog
#
# Perform daily/weekly/monthly maintenance.
1 3 * * * root periodic daily
15 4 * * 6 root periodic weekly
30 5 1 * * root periodic monthly
#
# Adjust the time zone if the CMOS clock keeps local time, as opposed to
# UTC time. See adjkerntz(8) for details.
1,31 0-5 * * * root adjkerntz -a
15 23 * * * freebsd /usr/local/bin/dokuwiki_brigitta.sh
45 23 * * * freebsd /usr/local/bin/dokuwiki_brigitta_delete.sh
eseguo lo script di back up:
$ cat /usr/local/bin/dokuwiki_brigitta.sh
#!/bin/sh
# Lo faccio eseguire da cron ogni giorno alle 23.15
# Cf. /etc/crontab
present=`date +'%j_%Y'`
tar --exclude=/usr/local/www/dokuwiki/data/cache -cvzf /usr/home/freebsd/bkk/DokuWiki_Brigitta_$present.tar.gz /usr/local/www/
Mi collego al server dal [[dell_poweredge_t20|Dell_T20_ZFS]] in Istituto via Rsync per prendere il file di back up:
$ cat /usr/local/bin/dokuwiki_NUC.sh
#!/bin/sh
# Lo faccio eseguire da cron ogni mattina alle 5.
present=`date +'%j_%Y'`
rsync ks:/home/francesco/bkk/DokuWiki_$present.tar.gz /home/francesco/bkk_dokuwiki
$ cat /usr/local/bin/dokuwiki_brigitta_NUC.sh
#!/bin/sh
# Lo faccio eseguire da cron ogni mattina alle 5.
present=`date +'%j_%Y'`
rsync ks:/home/francesco/bkk/DokuWiki_Brigitta_$present.tar.gz /home/francesco/bkk_dokuwiki
e poi concello il file di back up sulla Virtual machine [[DigitalOcean]]:
$ cat /usr/local/bin/dokuwiki_brigitta_delete.sh
#!/bin/sh
# Lo faccio eseguire da cron ogni giorno alle 23.45.
# Nel frattempo, alle 23.30, il server Dell_T20_ZFS dovrebbe farne un rsync
# Cf. /etc/crontab
present=`date +'%j_%Y'`
rm /usr/home/freebsd/bkk/DokuWiki_Brigitta_$present.tar.gz