Quoting Richard E. Brown Richard.E.Brown@DARTWARE.COM [Mar 08, 2002 11:28]:
A while back, there was a thread in rt-users that mentioned there was a
backup procedure for RT at ftp://ftp.fsck.com/pub/rt/rt1-contrib I
can’t get to that host now.
What I really want is a recipe that:
a) Backs up the mySQL database (it can dump all the tables - I
only have RT running)
b) Backs up all my RT source files (from all the places they might
have been placed during the installation process)
c) Backs up anything else that I might need
d) Restores all this stuff.
You could do this with a short shell script (Warning! This is
untested! I just threw this together right now!):
MYSQL_OPTS="-urt_user -prt_password -h rt_host RT_DB_NAME"
case $* in
# Restoe db
mysql $MYSQL_OPTS < /backups/$RESTORE_DATE/database
# Restore rt
gunzip -c /backups/$RESTORE_DATE/rt.tar.gz | tar xf -
# Assumes that /backups exists, of course
if ! test -d /backups/$DATE; then mkdir /backups/$DATE; fi
# Backup db and RT dir
mysqldump $MYSQL_OPTS > /backups/$DATE/database
tar cf /backups/$DATE/rt.tar $PATH
gzip --best /backups/$DATE/rt.tar
echo "Usage: $0 (save|restore)"
Mosher’s Law of Software Engineering:
Don’t worry if it doesn’t work right.
If everything did, you’d be out of a job.