| Both sides previous revisionPrevious revisionNext revision | Previous revision |
| servers:bsd:nginx:mybb [2026/01/09 14:30] – [Git Fix] Sean Rhone | servers:bsd:nginx:mybb [2026/01/09 17:22] (current) – [MySQL Connection] Sean Rhone |
|---|
| #!/bin/sh | #!/bin/sh |
| |
| su -m 'www' -c "git -C '/usr/local/www/forum' reset --hard 'origin/feature'" | cd '/tmp' |
| su -m 'www' -c "git -C '/usr/local/www/forum' pull 'origin' 'feature' --rebase" | |
| | '/usr/bin/su' -m 'www' -c "'/usr/local/bin/git' -C '/usr/local/www/forum' reset --hard 'origin/feature'" |
| | '/usr/bin/su' -m 'www' -c "'/usr/local/bin/git' -C '/usr/local/www/forum' pull 'origin' 'feature' --rebase" |
| | |
| | '/bin/sync' |
| |
| # End</code> | # End</code> |
| cd '/tmp' | cd '/tmp' |
| |
| '/usr/bin/tar' -czf '/home/espionage724/backups/piwigo-files-auto-'$(date +%Y-%m-%d)'.tar.gz' -C '/usr/local/www' 'media' | '/usr/bin/tar' -czf '/home/espionage724/backups/mybb-files-auto-'$(date +%Y-%m-%d)'.tar.gz' -C '/usr/local/www' 'forum' |
| |
| '/usr/local/bin/mariadb-dump' --single-transaction --quick 'piwigo' -r '/home/espionage724/backups/piwigo-database-auto-'$(date +%Y-%m-%d)'.sql' | '/usr/local/bin/mariadb-dump' --single-transaction --quick 'mybb' -r '/home/espionage724/backups/mybb-database-auto-'$(date +%Y-%m-%d)'.sql' |
| |
| '/bin/sync' | '/bin/sync' |
| #!/bin/sh | #!/bin/sh |
| |
| su -m 'www' -c "'/usr/local/bin/git' -C '/usr/local/www/blog' gc --aggressive --prune='all'" | cd '/tmp' |
| su -m 'www' -c "'/usr/local/bin/git' -C '/usr/local/www/blog' fsck --full --strict" | |
| | '/usr/bin/su' -m 'www' -c "'/usr/local/bin/git' -C '/usr/local/www/forum' gc --aggressive --prune='all'" |
| | '/usr/bin/su' -m 'www' -c "'/usr/local/bin/git' -C '/usr/local/www/forum' fsck --full --strict" |
| |
| # End</code> | # End</code> |
| |
| * :!: Set email for ''user.email'' | * :!: Set email for ''user.email'' |
| * :!: [[#initial_setup|Initial set-up]] needs re-completed for database connection ((re-use existing details)) | |
| |
| mkdir -p ~/'.local/scripts/www/blog' && ee ~/'.local/scripts/www/blog/git-fix.sh' && chmod +x ~/'.local/scripts/www/blog/git-fix.sh' | mkdir -p ~/'.local/scripts/www/forum' && ee ~/'.local/scripts/www/forum/git-fix.sh' && chmod +x ~/'.local/scripts/www/forum/git-fix.sh' |
| |
| <code> | <code> |
| su | su |
| |
| rm -Rf '/usr/local/www/forum' | ls '/home/'$USER'/mybb-files-'*'.tar.gz' && rm -Rf '/usr/local/www/forum' |
| |
| tar -xzf '/home/'$USER'/mybb-files-'*'.tar.gz' -C '/usr/local/www' 'forum' && chown -R 'www':'www' '/usr/local/www/forum' && sync | tar -xzf '/home/'$USER'/mybb-files-'*'.tar.gz' -C '/usr/local/www' 'forum' && chown -R 'www':'www' '/usr/local/www/forum' && sync |
| su - | su - |
| |
| su -m 'www' -c "ee '/usr/local/www/forum/inc/config.php'" | su -m 'www' -c "ee '/usr/local/www/forum/inc/config.php'" && clear |
| |
| <code>$config['database']['hostname'] = '127.0.0.1';</code> | <code>$config['database']['hostname'] = '127.0.0.1';</code> |
| |