Link to home
Start Free TrialLog in
Avatar of amadojimenzp
amadojimenzpFlag for Dominican Republic

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.
Avatar of farzanj
farzanj
Flag of Canada image

compile?  Which compiler or just make a list of files?
Avatar of amadojimenzp

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.

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.
after it is converted in a archive .tar, that it send me to a remote server by scp.
ASKER CERTIFIED SOLUTION
Avatar of farzanj
farzanj
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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
thank you very much farzanj.
You are welcome