Apache2Triad Help, Support and Development Forum Index Search Profile Log in to check your private messages Log in Register Memberlist Attachments Statistics Crew/Ranks Archive
 Backup apache2triad
Google
Post new topic Reply to topic
Author Message
stooi
 
 


Joined: 31 Dec 2004
Posts: 2

PostPosted: Fri Dec 31, 2004 3:07 pm Reply with quoteBack to top

How can I backup everything that I've installed and changed since I first install apache2triad. I mean EVERYTHING and how do I restore it back?

Thanks

ST Ooi
View user's profileSend private message
Vlad Alexa Mancini
lead developer
lead developer


Joined: 07 Jul 2003
Posts: 1539

PostPosted: Fri Dec 31, 2004 7:04 pm Reply with quoteBack to top

see my reply on http://apache2triad.net/forums/viewtopic.php?t=870
View user's profileSend private message
stooi
 
 


Joined: 31 Dec 2004
Posts: 2

PostPosted: Fri Dec 31, 2004 11:27 pm Reply with quoteBack to top

OK, the most important part is my email accounts, currently I have 3 domains hosted and I wanted to make a backup regularly to avoid any disaster.

Does anyone has any script that could backup all files all at once and restore to another system?
View user's profileSend private message
door33
tester
tester


Joined: 28 May 2004
Posts: 67
Location: US

PostPosted: Sat Jan 01, 2005 12:10 am Reply with quoteBack to top

yea i made this script a while back but you need to edit it so that it fits your needs use it at your own risk

- Aug 27 2005 Update
Updated code.

- June 29, 2005 Update
No more need for rar.exe just need to have python.
Automatically finds apache2triad install dir
Code:

#!f:/apache2triad/python/bin/python.exe
#
# Backup Script
# By : Frank Barela
# Email : frank<at>slickcode.org
#
import os
import os.path
import _winreg
import tarfile

handle=_winreg.ConnectRegistry(None, _winreg.HKEY_LOCAL_MACHINE)
result=_winreg.OpenKey(handle,"SOFTWARE\\Apache2triad")
name,value,type=_winreg.EnumValue(result,1)
a2t_path = value

if not os.path.exists("C:/apache2triadbackup"):
   os.makedirs("C:/apache2triadbackup")


tar = tarfile.open("C:/apache2triadbackup/apache2triad_backup.tar", "w")
for name in [os.path.join(a2t_path, "conf")]:
    tar.add(name)
for name in [os.path.join(a2t_path, "htdocs")]:
    tar.add(name)
for name in [os.path.join(a2t_path, "ftp","slimftpd.conf")]:
    tar.add(name)
for name in [os.path.join(a2t_path, "mail","mailusers.tab")]:
    tar.add(name)
for name in [os.path.join(a2t_path, "mail","domains.tab")]:
    tar.add(name)
for name in [os.path.join(a2t_path, "mysql","data")]:
    tar.add(name)
tar.close()


Last edited by door33 on Thu Aug 10, 2006 8:35 pm; edited 7 times in total
View user's profileSend private messageAIM AddressMSN Messenger
LiquidSnake
past contributor
past contributor


Joined: 23 May 2004
Posts: 267
Location: Middlesboro, KY

PostPosted: Sat Jan 01, 2005 12:50 am Reply with quoteBack to top

If you wanted an automated process, you could tell the task scheduler to run that script as well..

Also, you may want to be carefully by simply zipping up data in MySql, should export the data.. Problem is, if you just zip it, the new mysql may not recognize the format. this is a problem I ran into writing my apache2triad backup proggie. however if you export the data, you'll have no problems recovering.


Last edited by LiquidSnake on Sat Dec 30, 2006 7:57 am; edited 1 time in total
View user's profileSend private messageSend e-mailYahoo Messenger
mastertr
 
 


Joined: 24 Jul 2006
Posts: 24

PostPosted: Tue Aug 08, 2006 8:52 am Reply with quoteBack to top

how do i run this script?
View user's profileSend private message
Display posts from previous:      
Post new topic Reply to topic


 Jump to:   



View next topic
View previous topic
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum
Powered by phpBB © 2001, 2002 phpBB Group :: FI Theme
All times are GMT