Page 1 of 1

Backup script

Posted: 26 Mar 2008 12:23
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 !

Re: Backup script

Posted: 26 Mar 2008 16:21
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)

Re: Backup script

Posted: 27 Mar 2008 00:28
by cavagnaro
The lord has spoken!

Re: Backup script

Posted: 29 Mar 2008 12:01
by tot3nkopf
And we all still feel shiver down our spines :lol:

Re: Backup script

Posted: 02 Apr 2008 06:34
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

Re: Backup script

Posted: 20 Nov 2009 00:41
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?