Shell Scripting

Shell Scripting
I need Shell scripting expert, i have one sctipt already done but needs
modification or make itbetter. the current script is running on Solaris OS
and the role of this script is to do remote backup which means daily run to remote login to
network devices and run a command to show the current config and and copy it to the backup server.
Writing the file to the backup server with specific proceadure you will understand it from the script.

The current bakcup process is using two file one for the script and the second
one addresses file which has the ips and hostnames of devices whcih needd to be backed

so the script is reading the required information from the address file. The address file
is normal text file , entries are entered per line, so each device information in one line
seperated by : like this and on this order

Device IP:password:FolderName on the backup server:device host name

This script is running on crontab twice monthly

the requirements:

1- Advanced Backup Script:

The current script to be utilised and to be improved to do the following:

A- Sometimes while the script is connecting to the router and run the command and then
send the output to a file in the backup server ? i received a file with size=0, empty
file which means no backup, maybe the connection was down , or device was down , or network conjuction or any other reasons,
The required , we need the script to be clever and retries to connect and get the backup and only the failed ones after 4 hours from previous defined time in the crontab.
So it depends on you if you have an idea to implement this , maybe the failed backup hostnames to written in a another new file and then script will run again automaticlly
but this time will read from the second file to try to get the backup for them.

B- I need the script to send a report after the first run and the re-try run so one report to be send to an company email from the server,this report should show
status of the backup for all devices and the time backup taken , for all wether from the first run or after retry. How you will do this especially there is two run ?
the fist run status report to be stored in a file , then second staus report comes and consolidated together and to be sent. Tell me how to configure email in solaris.
by the way, i need the devices to be in order alphatically according to the device host name.

C- currently my script is using tftp which is not secure , you may still use it however i need a second version with secure coomunication between solaris machines and routers.
by the way , the devices are cisco routers , you may check what they support ?? maybe ssh.

2- I need another script , you may edit the current one , for manual backup , to be used before and after change. network engineers will have the script in their home directory,
and when every time they like to backup the configuration of the router , they run a script , which will ask the engineer to enter only the host name of the router , then the script
should validate his input with address data bases , if the device is not there or wrong written , it will give him error , otherwise it will aks him to confirm the request of
backup then , it script will do the normal process again as in the my script and will get the information required from address file and then confirm the status of the backup and thank the user.

4- running remote command,

I need a script to give it to the engineers who are responsible for the routers to run it when they want to run a command on big number of routers. the
script will be in the solaris machine on their home directory. For sure for now you know we have the address file which is the database for all devices
with their passowrds.The idea i don’t want the engineers to know the password. you can utilise the current script as it is dowing approximatelly same job,
i will like the script to read only hostnames from a different file then th script will go to our database ( the address file) to get other required details to connect
and login and then do the job.

please mail for any question or clarification.

The scripts all simple and all are same with just some modification and you can utilise the current script.

The payment will be done once the script is tested and working fine and reach satisfaction.

Leave a Reply

Your email address will not be published. Required fields are marked *