#!/bin/bash # Navigate to wiki data pages cd /var/www/html/wiki/data/pages/ # Sync the text pages that have changed from server, excluding the about page # (which are different), and the footer page. rsync -apP -e ssh --delete --exclude 'about/home.txt' --exclude 'footer.txt' \ --exclude 'nextcloud/login.txt' \ patrick@scarcs.ca:~/sites/aredn/data/pages/ /var/www/html/wiki/data/pages/ # Sync the media files that have changed from server. rsync -apP -e ssh --delete patrick@scarcs.ca:~/sites/aredn/data/media/ \ /var/www/html/wiki/data/media/ # Write custom footer page to note the date of last sync. echo 'Last synchronized from [[https://wcaredn.ca]] on' \ $(date) '' > footer.txt # Update ownership and permissions that might have been lost during the sync chown aredn:www-data -R /var/www/html/wiki/data/ chmod 770 -R /var/www/html/wiki/data/ # Refresh the cache to make the changes visible. touch /home/aredn/html/wiki/conf/local.php