Welcome to the Builder Academy

Question Backup your mud with this shell script!

More
09 Oct 2016 13:20 #6198 by rudeboyrave
Create a file named backup.sh in your root directory for your mud account and edit the lines below to match the paths to your world, obj and any directories you want backed up. simply do a "./backup.sh" from your shell prompt to do a quick backup when you need to.
Code:
#!/bin/bash BACKUP_DIR="/home/cyber/backups" time=`date '+%m'-'%d'-'%y'` tar -cvzf $BACKUP_DIR/CA.player.backup-$time.tgz /home/cyber/CA.conversion/lib/plr* tar -cvzf $BACKUP_DIR/CA.code.backup-$time.tgz /home/cyber/CA.conversion/src/ tar -cvzf $BACKUP_DIR/CA.world.backup-$time.tgz /home/cyber/CA.conversion/lib/world/ tar -cvzf $BACKUP_DIR/CA.storage.backup-$time.tgz /home/cyber/CA.conversion/lib/storage/ tar -cvzf $BACKUP_DIR/CA.world.backup-$time.tgz /home/cyber/CA.conversion/lib/world/ tar -cvzf $BACKUP_DIR/CA.vehicle.backup-$time.tgz /home/cyber/CA.conversion/lib/vehicles echo done.

CyberASSAULT
www.cyberassault.org
cyberassault.org 11111
A post-apocalyptic, sci-fi MUD.

Please Log in or Create an account to join the conversation.

More
18 Apr 2017 00:02 #6636 by krell
You must be a Linux user, because you seem to think that all shells are Bourne again! (See what I did there?).

Anyhow, that's a nice little script though I'd probably change the hash-bang to point at simple Bourne to make it more portable for those of us who don't use BASH. Thanks for posting your script. :-)

Please Log in or Create an account to join the conversation.

Time to create page: 0.174 seconds