MOTDs32/crontab.backup
2020-05-18 20:10:19 +02:00

155 lines
11 KiB
Plaintext

# crontab 2019
# >/dev/null -- aucun log
# &>/dev/null -- aucun log
# 2>&1 -- only error
# >/dev/null 2>&1 -- only error
# output=$(command) # stdout only; stderr remains uncaptured
# output=$(command 2>&1) # both stdout and stderr will be captured
#@weekly /sbin/iptables-save > /home/backup/iptables.echo.firewall
#iptables -L INPUT -v --line-numbers
### 666.echosystem.fr
#8 6 * * * curl -fsS --retry 3 http://localhost:8037/ping/9df6cf0c-0146-4926-8e09-ec332d2ff825 > /dev/null
### Freshrss
#52 * * * * /usr/bin/goaccess /etc/goaccess.conf -a -o /home/www-adm1n/MonitorinG/Goaccess/goaccess-cron.html &>/dev/null
### StatRRD ### https://adm1n.echosystem.fr/graph-statRRD.php
### https://adm1n.echosystem.fr/graph-StatusServ32.php
#*/2 * * * * su -s /bin/bash www-data -c "/bin/bash /home/www-adm1n/MonitorinG/StatusServ32/statRRD graph" >/dev/null
### OK WORK https://adm1n.echosystem.fr/RRDTOOL/traffic.cgi
#* * * * * echo "loadavg=`cat /proc/loadavg`" | curl -d @- https://adm1n.echosystem.fr/MonitorinG/statusboard-server-load/
#update OLD https://adm1n.echosystem.fr/RRDTOOLHOME/StatsRRD.php
#* * * * * rrdupdate /home/tools/StatRRD/rrd/trafic_eth0.rrd $(/bin/grep eth0 /proc/net/dev | cut -d: -f2 | awk -v ts=`date +\%s` '{print ts":"$1":"$9}') && rrdupdate /home/tools/StatRRD/rrd/temperature.rrd $(echo "$(/bin/cat /sys/class/thermal/thermal_zone0/temp)/1000" | bc |awk -v ts=`date +\%s` '{print ts":"$1}') && rrdupdate /home/tools/StatRRD/rrd/cpu.rrd $(uptime | cut -d: -f5 | tr ',' ' ' | awk -v ts=`date +\%s` '{print ts":"$1":"$2":"$3}') && rrdupdate /home/tools/StatRRD/rrd/memoire.rrd $(/bin/grep Mem /proc/meminfo | cut -d: -f2 | tr 'kB\n' ' ' | awk -v ts=`date +\%s` '{print ts":"$1":"$2}')
#*/5 * * * * /bin/bash /home/tools/StatRRD/Old/rrdtool.cron.sh | 2>&1
#############################################################################################
# at 5 a.m every week with: # 0 5 * * 1 tar -zcf backups/home.tgz /home/ --> &>/dev/null
# ┌────────── minute (0 - 59)
# │ ┌──────── hour (0 - 23)
# │ │ ┌────── day of month (1 - 31)
# │ │ │ ┌──── month (1 - 12)
# │ │ │ │ ┌── day of week (0 - 6 => Sunday - Saturday, or 1 - 7 => Monday - Sunday)
# │ │ │ │ │
# ↓ ↓ ↓ ↓ ↓
# * * * * * command to be executed
# m h dom mon dow command
SHELL=/bin/bash
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/home/composer/.composer/vendor/bin:/opt/node/bin:/usr/local/go:/usr/local/go/bin/bin:/home/tools/SH:/home/composer/Web_install/phpqa:/root/bin:/home/tools/GIT_stat/gitinspector
#PATH=$PATH:/home/tools/SH:/home/composer/Web_install/phpqa:/root/bin
#PATH=$PATH:/home/tools/GIT_stat/gitinspector
@reboot sh /etc/init.d/AuReboot
### MonitorinG
5 * * * * vnstati -s -i eth0 -o /home/www-adm1n/MonitorinG/vnstat/summary.png >/dev/null
2 * * * * vnstati -h -i eth0 -o /home/www-adm1n/MonitorinG/vnstat/hourly.png >/dev/null
2 * * * * vnstati -d -i eth0 -o /home/www-adm1n/MonitorinG/vnstat/daily.png >/dev/null
2 * * * * vnstati -t -i eth0 -o /home/www-adm1n/MonitorinG/vnstat/top10.png >/dev/null
2 * * * * vnstati -m -i eth0 -o /home/www-adm1n/MonitorinG/vnstat/monthly.png >/dev/null
### Stats GIT
### #SHELL=/bin/bash #PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/home/tools/gitinspector
# MOTDs32
#2 */6 * * * cd /root/MOTDs32 ; git log --stat --no-merges --summary > /home/www/html/_page/GITSTAT/MOTDs32/log/repo_log
2 * * * * sudo /usr/bin/python /home/tools/GIT_stat/gitinspector/gitinspector.py --format=htmlembedded --file-types=** -HlmrTw /root/MOTDs32/ > /home/www/html/_page/GITSTAT/MOTDs32/gitinspector/index.html >/dev/null 2>&1
2 * * * * /usr/local/bin/gitstats /root/MOTDs32/ /home/www/html/_page/GITSTAT/MOTDs32/gitstats/ >/dev/null 2>&1
2 * * * * /usr/local/bin/repostat --no-browser --copy-assets /root/MOTDs32/ /home/www/html/_page/GITSTAT/MOTDs32/repostat/ >/dev/null 2>&1
2 * * * * sudo /usr/local/bin/git_stats generate --path=/root/MOTDs32/ --out-path=/home/www/html/_page/GITSTAT/MOTDs32/git_stats/ >/dev/null 2>&1
# 2>&1
# Bash3lper
#2 */6 * * * cd /home/erreur32/Bash3lper ; git log --stat --no-merges --summary > /home/www/html/_page/GITSTAT/Bash3lper/log/repo_log
2 * * * * sudo /usr/bin/python /home/tools/GIT_stat/gitinspector/gitinspector.py --format=htmlembedded --file-types=** -HlmrTw /home/erreur32/Bash3lper/ > /home/www/html/_page/GITSTAT/Bash3lper/gitinspector/index.html >/dev/null 2>&1
2 * * * * /usr/local/bin/gitstats /home/erreur32/Bash3lper/ /home/www/html/_page/GITSTAT/Bash3lper/gitstats/ >/dev/null 2>&1
2 * * * * /usr/local/bin/repostat --no-browser --copy-assets /home/erreur32/Bash3lper /home/www/html/_page/GITSTAT/Bash3lper/repostat/ >/dev/null 2>&1
2 * * * * sudo /usr/local/bin/git_stats generate --path=/home/erreur32/Bash3lper/ --out-path=/home/www/html/_page/GITSTAT/Bash3lper/git_stats/ >/dev/null 2>&1
#5 4 * * * /usr/bin/gitstats /root/MOTDs32/ /home/www/html/MOTDs32/Stats/ && curl -fsS --retry 3 https://x20.echosystem.fr/ping/2494d5a8-998f-4322-a298-c9b5e5265bbd > /dev/null
############################################################
# MAJ
@monthly /home/tools/certbot/certbot-auto renew --apache --force-renew
@weekly /etc/ipset-blacklist/update-blacklist.sh /etc/ipset-blacklist/ipset-blacklist.conf
@daily /home/tools/SH/mail-fail2ban-report.sh
#@weekly /usr/sbin/tiger -H -E -l /home/www-adm1n/tiger/ && chown www-data /home/www-adm1n/tiger/ -R
@weekly /home/tools/SH/updater-netdata.sh
@weekly /home/tools/SH/optimize-db.sh
#@weekly failstatus
#@daily /bin/bash /home/tools/SH/updater-youtub-dl.sh 2>&1
#@daily /home/tools/SH/updater-youtub-dl.sh
#*/5 * * * * /home/tools/SH/updater-youtub-dl.sh
####################################
## Apache ## Clean cache blog.echosystem.fr
#@daily wget --spider -qO- "https://blog.echosystem.fr/.admin_/_rss.ajax.php?guid=ea62141e847746780f11ece6dabcaa7b23cd5b64&refresh_all"
#*/4 * * * * chown mysql:adm /var/log/mysql/error.log
#*/4 * * * * chown www-data:adm /var/log/apache2 -Rf
#*/4 * * * * chmod 754 /var/log/apache2 -Rf
############################# BACKUP
# ┌────────── minute (0 - 59)
# │ ┌──────── hour (0 - 23)
# │ │ ┌────── day of month (1 - 31)
# │ │ │ ┌──── month (1 - 12)
# │ │ │ │ ┌── day of week (0 - 6 => Sunday - Saturday, or 1 - 7 => Monday - Sunday)
# │ │ │ │ │
# ↓ ↓ ↓ ↓ ↓
# * * * * * command to be executed
# m h dom mon dow command
### BACKUP
#@monthly /bin/cp -f /usr/share/nano/* /home/backup/Backup-nano/
@monthly /home/tools/SH/Cron-package-installed.sh &>/dev/null
@monthly /bin/cat /root/.bash_history > /home/backup/.bash_history_back
@monthly /home/tools/SH/Cronall.sh > /home/backup/Crontab-save
@monthly /bin/bash /home/tools/SH/Backup-Home-tools.tar.gz.sh
# Tous les Lundi
1 1 * * 1 /bin/bash /home/tools/SH/Backup-Sql-date.sh
2 2 * * 1 /bin/bash /home/tools/SH/Backup-Root.tar.gz.sh
3 3 * * 1 /bin/bash /home/tools/SH/Backup-Home-git.tar.gz.sh
4 4 * * 1 /bin/bash /home/tools/SH/Backup-Home-www.tar.gz.sh
4 5 * * 1 /bin/bash /home/tools/SH/Backup-Home-www-grav.tar.gz.sh
# Tous les 2 et 20 du mois
5 5 2,20 * * /bin/bash /home/tools/SH/Backup-Home-www-ADM1N.tar.gz.sh
# Tous les 12 et 14 du mois
11 5 12 * * /bin/bash /home/tools/SH/Cron-backup-ECHO-btsync-START
11 6 14 * * /bin/bash /home/tools/SH/Cron-backup-ECHO-btsync-STOP
33 3 28 * * /bin/bash /home/tools/SH/Backup-Home-youtube.tar.gz.sh
# Tous les 2 du mois
1 1 2 * * /bin/bash /home/tools/SH/Backup-BIN.tar.gz.sh
2 2 2 * * /bin/bash /home/tools/SH/Backup-ETC.tar.gz.sh
3 3 2 * * /bin/bash /home/tools/SH/Backup-VAR-LOG.tar.gz.sh
4 4 2 * * /bin/bash /home/tools/SH/Backup-VAR.tar.gz.sh
6 6 2 * * /bin/bash /home/tools/SH/Backup-Home-erreur32.tar.gz.sh
#53 5 27 * * /bin/bash /home/tools/SH/Backup-Home-ircd.tar.gz.sh
#38 * * * * chown www-data /var/log/piwik-archive.log && su -s /bin/bash www-data -c "/usr/bin/php /home/www/html/piwik/console core:archive --url=https://echosystem.fr/PiwM/ --force-all-websites" > /var/log/piwik-archive.log
#41 */6 * * * /etc/init.d/apache2 restart &> /dev/null
13 */6 * * * su -s /bin/bash www-data -c "/usr/bin/php /home/www/html/piwik/console core:archive --url=https://echosystem.fr/PiwM/" > /var/log/piwik-archive.log
*/21 * * * * su -s /bin/bash www-data -c "php /home/www/RSS/app/actualize_script.php" > /tmp/RSS.log 2>&1
### GOACCESS
53 * * * * /bin/zcat -f /var/log/apache2/access.log* | /usr/local/bin/goaccess --log-format=VCOMBINED -a -o /home/www-adm1n/MonitorinG/Goaccess/All-log-goa.conf.html --html-report-title All-log-goa.conf > /dev/null 2>&1
57 * * * * su -s /bin/bash www-data -c "/usr/local/bin/goaccess -a -o /home/www-adm1n/MonitorinG/Goaccess/goaccess-cron.html"
57 * * * * /bin/zcat -f /var/log/apache2/access.youtube.oueb.net.log* | /usr/bin/goaccess - --no-global-config --log-format=VCOMBINED -o /home/www-adm1n/MonitorinG/Goaccess/youtube.oueb.net.html --html-report-title youtube.oueb.net >/dev/null 2>&1
58 * * * * /bin/zcat -f /var/log/apache2/access.log* | grep -F "rss " | grep -vE '(wallabag|public|blog|ns336667)' | /usr/bin/goaccess - --no-global-config --log-format=VCOMBINED -o /home/www-adm1n/MonitorinG/Goaccess/rss-all.html --html-report-title rss-all >/dev/null 2>&1
59 * * * * /bin/zcat -f /var/log/apache2/access.breakingbad.echosystem.fr.log* | /usr/bin/goaccess - -p /etc/goaccess-breakingbad.conf --log-format=VCOMBINED -o /home/www-adm1n/MonitorinG/Goaccess/breakingbad.html --html-report-title breakingbad >/dev/null 2>&1
# /home/tools/SH/goaccess-mail.sh
# grep -h "/rss.php " /var/log/apache2/access.log* | /usr/bin/goaccess --log-format=COMBINED -o /home/www-adm1n/MonitorinG/Goaccess/rss-blog.html
####
* * * * * cd /home/www/html/Grav;su -s /bin/bash www-data -c "/usr/bin/php bin/grav scheduler" 1>> /dev/null 2>&1
*/3 * * * * su root -c "/usr/bin/php -q /home/www-adm1n/phpservermon-git/cron/status.cron.php" > /dev/null
#*/3 * * * * su -s /bin/bash www-data -c "/usr/bin/php -q /home/www-adm1n/phpservermon-git/cron/status.cron.php" > /dev/null
41 * * * * su -s /bin/bash www-data -c "/usr/bin/php -q /home/www-adm1n/MonitorinG/loadavg/logger.php" >/dev/null
*/5 * * * * su -s /bin/bash www-data -c "/bin/bash /home/www-adm1n/StatRRD/statRRD graph" > /dev/null
*/5 * * * * su -s /bin/bash www-data -c "/usr/bin/php /home/www/info_social/protected/yii queue/run" >/dev/null 2>&1
*/5 * * * * su -s /bin/bash www-data -c "/usr/bin/php /home/www/info_social/protected/yii cron/run" >/dev/null 2>&1
#*/3 * * * * perl /usr/local/bin/rrd_traffic.perl >/dev/null
48 * * * * /usr/bin/vnstat -u &>/dev/null
*/5 * * * * /usr/bin/motds32 -g >/dev/null 2>&1