+ sample crontab

This commit is contained in:
nicobo 2023-06-22 12:42:49 +02:00 committed by GitHub
parent 66d9eb2215
commit a073ba9661
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -25,3 +25,16 @@ Run without arguments to show the full syntax (including how to pass your Gandi
Put in a *cron job* to run on a regular basis and check if there was any change in the IP addresses of the email providers.
Without flattening, the 5 email providers from this example would produce 12 DNS requests, out of maximum 10 allowed.
## Sample crontab
The following cron entry will :
1. be triggered every hour
2. wait for random minutes
3. run the script for the given domain
4. exit if running more than 3 minutes (timeout)
5. write debug logs into /var/log/
Make sure to define your API key (may be passed as an environment variable).
@hourly sleep $((RANDOM*60/32768))m ; timeout --signal=9 3m /opt/gandi-flatten-spf.py -k ${GANDI_APIKEY} -d mydomain.com -e _spf.mailfence.com _spf.google.com _spf.mail.yahoo.com _mailcust.gandi.net _spf.protonmail.ch -l DEBUG >/var/log/gandi-flatten-spf-mydomain.com.log 2>&1