automatically?
One way to solve the problem:
Basically we just take ssh connection to the remote computer, and make that
computer to execute scp command to our own IP address. The way I used requires
installation of package called expect to your home machine. Well, it's nice program
though, and allows many other things too

to interact with a process.
If you use fedora, or some other clever distribution, you can smile happily while using
yum or aptget or something else... Other vice you need to search for the rpm(s)
required to install expect and to meet the dependencies.
Here's a example script I used to copy the sensordata from my work computer to
home computer:
Code: Select all
#!/usr/bin/expect f <where the expect is installed>
set timeout 4 <how long expect waits for thing expected>
spawn /usr/bin/ssh [email protected] <launch 'interactive' process (connect to one server>
expect "password:$" <what to expect before proceeding>
send "passwd\r\n" <send text to the process>
expect "paju:(~)"
send "ssh username@workserver\r\n"
expect "password:$"
send "passwd2\r\n"
expect "user@linux:~>"
send "scp Envir_measure/cardsoft/softa/log_press/sensor_data.txt
[email protected]ip.info:humidity_19_03/.\r\n" <I used DNS name instead IP>
expect "password:$"
send "passwd\r\n"
set timeout 400 <since datafiles were big, transfer took a while...>
expect "matti@linux:~>"
send "exit\r\n"
set timeout 4
expect "paju:(~)(53)%"
send "exit\r\n"
expect "\[Matti@localhost humidity_19_03\]$"
interact
remove <explanation> comments
Now either create a program which executes the script when needed, or put it in
crontab to be executed hourly/daily/weekly/monthly
Then grant execute permission for the script with command
chmod a+x /etc/cron.daily/scriptname