amadojimenzp
asked on
script Expect (SCP and tar)
Good morning,
I have a solaris system with expect installed, I don't know how to achieve a script to make this: a script that can access a directory called /Backup/Online and compile everything inside with a name and a date of the previous day, after it finishes the compiling, that it send me to a remote server by scp.
I'll aprecciate your help.
I have a solaris system with expect installed, I don't know how to achieve a script to make this: a script that can access a directory called /Backup/Online and compile everything inside with a name and a date of the previous day, after it finishes the compiling, that it send me to a remote server by scp.
I'll aprecciate your help.
compile? Which compiler or just make a list of files?
ASKER
A script that can access a directory called /Backup/Online and package ( command tar ) everything inside with a name and a date of the previous day, after it finishes the compiling, that it send me to a remote server by scp.
ASKER
Especifically a script which can access to a directory called /Backup/Online (CD command) and that everything that is inside that directory, is converted in and archive .tar (tar -cvf command) with the name and date of the previous day.
ASKER
after it is converted in a archive .tar, that it send me to a remote server by scp.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Sending as ssh using script is a whole new topic. You should enable public private keys for that purpose between the servers. Once you are able to do successfully, all you need is one simple last command, in the above script
#You need IP or FQDN AND target directory AND userID on that machine
ip=192.168.0.254
dir=/path/backup
tuser=auser
scp $backupName $tuser@$ip:$dir
#You need IP or FQDN AND target directory AND userID on that machine
ip=192.168.0.254
dir=/path/backup
tuser=auser
scp $backupName $tuser@$ip:$dir
ASKER
thank you very much farzanj.
You are welcome