0937504390
Programmer
I'v made a script for remote file backup
I need to check if directory ($TMPDIR) exists..
How can I check it in script?
My script
#!/usr/bin/expect -f
set timeout 100
set PASS ""
set USER "root"
set IPSERV ""
set BackupDirectories "/home/test1 /home/test2"
set TMPDIR "/home/backup5"
spawn ssh $USER@$IPSERV
expect "assword:"
send "$PASS\r"
expect "#"
# Now I need to check if remote directory $TMPDIR is exists !!!!!!!
send "tar -zcvf $TMPDIR/backup.tar.gz $BackupDirectories\r"
expect "#"
send "exit;\r"
expect eof
I need to check if directory ($TMPDIR) exists..
How can I check it in script?
My script
#!/usr/bin/expect -f
set timeout 100
set PASS ""
set USER "root"
set IPSERV ""
set BackupDirectories "/home/test1 /home/test2"
set TMPDIR "/home/backup5"
spawn ssh $USER@$IPSERV
expect "assword:"
send "$PASS\r"
expect "#"
# Now I need to check if remote directory $TMPDIR is exists !!!!!!!
send "tar -zcvf $TMPDIR/backup.tar.gz $BackupDirectories\r"
expect "#"
send "exit;\r"
expect eof