Backup script

Did you say hacking ?
Post Reply
Turlupin
Member
Posts: 101
Joined: 05 Jun 2007 07:59
Location: Paris / France

Backup script

Post by Turlupin »

Hello everybody !

To inogure this new section of the forum, i'm proposing to you the first version of a backup script wich permit you to change the default backup directory, directly export backup files on a ftp server and finally write log files (on cpu disk and ftp server) of backup actions.


The script is developed in php (i really suck with shell script language ...) so it will only work on OXE wich are running at least R5.1 (i hope :D , i developped it on R7.1)


I let you discover how to use it, for the begening just enter on the command line :

Code: Select all

[root@xa000001 root]# php super_bck -help
It will display the help of the script with the description of the parameters :

Code: Select all

usage: php super_bck BACKUP DESTINATION
Run the process backup for BACKUP into DESTINATION

Choice for BACKUP :
        mao : backup of the Mao
        mao-acc : backup of Mao, Voice guides and accounting
        acc : backup of the accounting data
        acd : backup of the ACD date (statistics) and configuration files
        vg : backup of the voices guides
        mao-dat : backup of the Mao data files
        obstraf : backup of the Traffic observation files
        cho-dat : backup of the Linux specific data
        noe : backup of the 8&9 series customized files
        ops : backup of OPS files *** NOT SUPPORTED YET ***
        4635j : backup the 4635j data *** NOT SUPPORTED YET ***
        eva : backup of the voicemail configuration *** NOT SUPPORTED YET ***
        eva-msg : backup of the voicemail configuration and messages *** NOT SUPPORTED YET ***

Choice for DESTINATION :
        local : to store the backup file on cpu disk in a personalised directory
        ftp : to store the backup file on a ftp server

To customize the configuration (backup directory, ftp server ...) edit the script file

Author : Remy Vallereau / Contact : remy@vallereau.net / link : http://www.alcatelunleashed.com

[root@xa000001 root]#


As you see, i launched the script as root. It permit to laucnh the backup process without prompting for the swinst password. If you want to use mtcl account you will need to enter the swinst password on the command line.

To simplify the command, you can create an alias in the .bashrc file :

Code: Select all

alias super_bck='php super_bck'
This will permit to launch the command super_bck with out the php prefix.


The script is fully customizable. You need to edit the script file and modify some global variables :

Here is the variable your can modify :

Code: Select all

$BACKUP_DEF="/usr4/BACKUP/IMMED/"; // Where the backup files are stored by default
$BACKUP_DEF_OPS="/usr4/BACKUP/OPS/"; // Where the backup of the OPS are stored
$BACKUP_DIR="/usr4/BACKUP"; // Where you want to store the backup files

$FTP_SERVER="pc"; // Address of the ftp serveur. It could be a hostname or directly and Ip adress
$FTP_PORT="21"; // Port of the ftp server
$FTP_USER="bck"; // Login
$FTP_PASSWD="bck"; // Password

$PATH_LOG_FILE="/usr4/BACKUP/"; // The path where the log file is saved
Warning : For the ftp serveur adress, you can directly write an Ip adress. If you want to use an url, you will need a dns server configured in netadmin or an entry in your hosts files (in /etc/hosts).


I hope this will be helpfull !

Sorry for my english ....

Bye !
You do not have the required permissions to view the files attached to this post.
Sorry for my english .... :)
User avatar
Eliott_DUP
Member
Posts: 793
Joined: 19 Apr 2007 11:20
Location: In front of my PC

Re: Backup script

Post by Eliott_DUP »

Turlupin wrote:As you see, i launched the script as root. It permit to laucnh the backup process without prompting for the swinst password. If you want to use mtcl account you will need to enter the swinst password on the command line.
No.
You can execute a backup as follows w/o the swinst password using a trick:

Code: Select all

/usr/bin/rsh -l swinst localhost /DHS3bin/soft_install/bin/bck -save mao-acc 1>output.txt 2>&1
8)
Never give up!
User avatar
cavagnaro
Alcatel Unleashed Certified Guru
Alcatel Unleashed Certified Guru
Posts: 7014
Joined: 14 Sep 2005 19:45
Location: Brasil, Porto Alegre
Contact:

Re: Backup script

Post by cavagnaro »

The lord has spoken!
Ignorance is not the problem, the problem is the one who doesn't want to learn

OTUC/ICS ACFE/ACSE R3.0/4.0/5.0/6.0
Certified Genesys CIV 8.5
Certified Genesys Troubleshooting 8.5
Certified Genesys BEP 8.x
Genesys Developer
User avatar
tot3nkopf
Alcatel Unleashed Certified Guru
Alcatel Unleashed Certified Guru
Posts: 4058
Joined: 02 Feb 2006 10:41
Location: Germany & Romania
Contact:

Re: Backup script

Post by tot3nkopf »

And we all still feel shiver down our spines :lol:
krzysioD
Alcatel Unleashed Certified Guru
Alcatel Unleashed Certified Guru
Posts: 1165
Joined: 30 Aug 2006 13:43
Location: Europe, Poland

Re: Backup script

Post by krzysioD »

Hello,
keep your pants on. :lol:

because if running 4.3 BSD also called a Ux Release you need to use:

Code: Select all

/chusr/bin/rsh localhost -l swinst /DHS3bin/soft_install/bin/bck -save mao-account-ctree 
Note, that the -l swinst and localhost has also changed positions.

Possible options are:
mao-account-ctree
mao
mao-ctree
account
account-ctree
mao-dat
account-dat
mao-dat-ctree
account-dat-ctree
vguides
Please note that at no time I will provide you with OXE/4400 nor AOS releases.
Note that it's our private time, that we spent to help you, so please don't expect complete solution for your problem.
You will need to do homework by your self.
archastro
Member
Posts: 5
Joined: 02 Oct 2008 01:32

Re: Backup script

Post by archastro »

Hi Guys,

One of the other options for this one is:

Code: Select all

/usr/bin/rsh -l swinst localhost /DHS3bin/soft_install/bin/bck -save ops 1>$
echo -e " >> \c "
which dumps the OPS files to /usr4/BACKUP/OPS

Has anyone had any luck with dumping 4645 or linux data with this method?
Post Reply

Return to “System Hacking”