Quick SCP command help

Associate
Joined
19 Jul 2006
Posts
1,847
I want to coppy a backup script from one server to another.

Im running the following as root on server with ip 10.0.6.24
Code:
scp backup 10.0.6.22:/etc/cron.d/
where the file backup is located on server 10.0.6.22 in the etc/cron.d folder.

It askes me for a password which i enter then it says
backup: No such file or directory

what am i doing wrong? as the file is there
 
ok new problem.
I have the following script on the server 10.0.6.22
Code:
#/bin/sh
cp -R /home/moodledata /backups/moodledatacopied/
tar -czvf /backups/moodledata/moodledata.tar.gz /backups/moodledatacopied/
mkdir -p /backups/moodledata/moodledata/`/bin/date +%Y/%b`
/bin/mv /backups/moodledata/moodledata.tar.gz /backups/moodledata/moodledata/`/bin/date +%Y/%b/moodledata_%d-%b-%Y.tar.gz`
rm -rvf /backups/moodledatacopied/

This script runs everyday and creates a file with the date at the end.

Now i need to get that file across to my desktop somehow automatically.

Would it be better to put a scp command in that script to send the file to the desktop? i take it id need to specify an account and password somewhere to.

Or would it be better to create a new script on my desktop that scp the file from the server. But then id have to make the script work out the date and find the correct file before scp?
 
Back
Top Bottom