Editing Comrade:MxAsh/AdminNotes/backup

Warning: You are not logged in, comrade. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be instead attributed to your username.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.

Latest revision Your text
Line 22: Line 22:


If you run this yourself you'll need to change the "shebang" line referencing bash, and the backupdir.
If you run this yourself you'll need to change the "shebang" line referencing bash, and the backupdir.
<pre>$ cat bin/wikibackup_pull.sh
<pre>#!/opt/homebrew/bin/bash -x
#!/opt/homebrew/bin/bash -x


backupdir='/Volumes/home/Misc_Backups/prolewiki'
backupdir='/Volumes/home/Misc_Backups/prolewiki'
datestamp="$(date +%Hh%d-%m-%Y)"


if [[ ! -d ${backupdir} ]]; then
if [[ ! -d ${backupdir} ]]; then
   echo "Cannot access backup directory \`${backupdir}\`, exiting" 1>&2
   echo "Cannot access backup directory \`${backupdir}\`, is nas2 mounted?" 1>&2
   exit 2
   exit 2
fi
fi
mkdir -pv ${backupdir}/{database,public_html}/


time rsync -ave 'ssh -p 22022' --delete root@www.prolewiki.org:/home/prole/public_html/ ${backupdir}/public_html/ 2>&1 | tee ${backupdir}/public_html_rsync.log
time rsync -ave 'ssh -p 22022' --delete root@www.prolewiki.org:/home/prole/public_html/ ${backupdir}/public_html/ 2>&1 | tee ${backupdir}/public_html_rsync.log
time rsync -ave 'ssh -p 22022' --delete root@www.prolewiki.org:/root/databases/ ${backupdir}/database/ 2>&1 | tee ${backupdir}/databases_rsync.log
time rsync -ave 'ssh -p 22022' --delete root@www.prolewiki.org:/root/databases/ ${backupdir}/database/ 2>&1 | tee ${backupdir}/databases_rsync.log</pre>
 
zip -Tr ${backupdir}/${datestamp}.zip ${backupdir}/database ${backupdir}/public_html
ProleWiki upholds the abolition of private property, including intellectual property, so feel free to publish any work at will.
Cancel Editing help (opens in new window)