Toggle menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

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 25: Line 25:
#!/opt/homebrew/bin/bash -x
#!/opt/homebrew/bin/bash -x


backupdir='/Volumes/home/Misc_Backups/prolewiki'
backupdir='/Volumes/home/Misc_Backups/prolewiki' # change to your local backup directory
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)