find /[FOLDER_NAME]/* -mtime +[OLDER_THAN_DAYS] -exec rm -rf {} \;
Example deletes all files and folders in tmp folder that are older than 180 days: find /tmp/* -mtime +180 -exec rm -rf {} \;
Handling DNS records from bash, including import of bind config zone file: https://github.com/tmiland/Cloudflare-BIND-Zone-File-Upload/blob/master…
You can see a lot of good information for debugging and fixing errors on your Ubuntu server with journalctl and dmesg
journalctl --since "1 days ago"
journalctl --since "10 hours ago"
journalctl --since "12 hours ago" -p 3 -x --utc --no-pager
dmesg | less
dmesg -H --time-format iso| less
Resources:
https://unix.stackexchange.com/questions/50098/linux-network-troublesho…
Wordpress runs it's cron job automatically approximately every 10 minutes. Sometimes it is blocked by .htaccess or other server configuration. To avoid issues, it might be a good idea to run from the server crontab itself.
References:
https://kinsta.com/knowledgebase/disable-wp-cron/
https://wpbeaches.com/set-up-wordpress-wp-cron-php-to-run-manually/
Example bash on argument 1. It checks if HTTPS is up and if the domain-name is on the site. Most sites have the domain name on the front page somewhere: /usr/local/nagios/libexec/check_http -H $1 --ssl --onredirect=follow --string "$1"
If log file you can run grep on the following keywords: grep -i -e "critical" -e "invalid" -e "warning" [LOGFILE.log]
Keywords: check_http
A nice little guide: https://tecadmin.net/run-shell-script-as-systemd-service/
If you experience false characters in your mysqldump, you might want to try to set the encoding specifically. Example with latin1:
mysqldump -u [USER] -p --opt --skip-set-charset --default-character-set=latin1 [DATABASE_NAME] > [OUTPUT_FILE_NAME].sql
Check different encoding settings in mysql when using a specific database: show variables like 'char%';
More info and tips: https://www.toptal.com/php/a-utf-8-primer-for-php-and-mysql