I know this may be off topic, but hoping someone may have experienced similar issues and provide some insight to resolve. I am trying to develop a script to backup Nextcloud data directory, MySQL DB and Nextcloud directory using Rsync. Script runs fine when initiated manually, but when scheduling in CRON is where Im having issues. The following is the script commands.
sudo mysqldump --defaults-file=/root/.my.cnf NC_DATABASE > NCMYSQL.sql;
sudo rsync -zr --log-file=rsyncDB NCMYSQL.sql 10.0.90.34::NCRSYNC/;
sudo rsync -zr --delete --log-file=rsyncNC_Dir /var/www/nextcloud 10.0.90.34::NCRSYNC/;
sudo rsync -zr --delete --log-file=rsyncNC_DATA /var/NC_DATA 10.0.90.34::NCRSYNC/;
The issue is that when ran in CRON the Nextcloud server comes to a grinding halt due to excessive load. Using HTOP I get the following (see attached image). Again, not sure why multiple rsync processes exits where STATE = D. Also have /usr/sbin/mysql where STATE = S. Rebooting server is the only way remove the hanging processes. Again, when ran manually all runs and completes successfully without high load issues,
Any insight would be much appreciated. Thank you.