File size: 840 Bytes
fe617ac
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/expect

set host "connect.nmb2.seetacloud.com"
set port "15054"
set user "root"
set password "9Dml+WZeqp5b"
set local_dir "."
set remote_dir "/root/autodl-tmp/book-rec-with-LLMs"

# 1. Tar (Local) - execute outside expect? No, expect can't run local shell easily.
# We assume user runs tar before script? 
# Or use python subprocess?
# Let's try to run tar via system call in expect if possible or run in terminal separately.
# Actually, I'll create the tarball first using run_command.

# 2. SCP Tarball
spawn scp -P $port project_bundle.tar.gz $user@$host:$remote_dir/
expect {
    "password:" { send "$password\r" }
}
expect eof

# 3. Untar (Remote)
spawn ssh -p $port $user@$host "cd $remote_dir; tar -xzf project_bundle.tar.gz"
expect {
    "password:" { send "$password\r" }
}
expect eof

puts "Full Bundle Sync Complete!"