Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

In my office, i have to schedule for moving a file from one computer to other computer (Both are using Elastix).

My idea is using cron, scp, and rm to do this. So here are the script that i use:

scp -r /home/data/* root@192.168.1.2:/home/data1 && rm -r /home/data/*

That script did the copy, but not remove the source file.

I already read this question: Hov to _MOVE_ files with scp?

The problem is, the computer doesn't have an internet connection. So i cannot install rsync on my elastix computer.

yum install rsync

Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile

and then it freezes.

Any idea how to do this?

share|improve this question

1 Answer 1

up vote 1 down vote accepted

If your script does only the copy but not the remove, then your scp was not successfull somehow. You could try to debug it by only executing the scp and check the return code: scp -r /home/data/* root@192.168.1.2:/home/data1; echo $? Return code should be zero for success. Add -v to scp to get more info. Check manually if everything went ok.

Regarding rsync: if your computer is not connected to the internet, use a computer connected to the internet, and use google to find a rpm for rsync for your distribution. Im am not familiar with elastix, but if you can't find rpms, try finding out what elastix is based on, and try a rpm for a similar distribution. Then downoad the rpm, transfer it on your elastix machine (e.g. via usb key) and install it with rpm -i <rsync.rpm>

share|improve this answer
    
elastix is based on CentOS, okay I will try. –  yudayyy Jul 5 '12 at 8:50
    
Okay, thank you @Isaac, rsync is now installed. I have to install rsync on both machine to get the rsync work right? –  yudayyy Jul 5 '12 at 10:08
    
Dear @Isaac, can I get a guide to fix this error: read only file system, i cannot make any directory on the other server. –  yudayyy Jul 5 '12 at 10:26
    
Yes, rsync needs to be installed on both machines. Regarding your read only file system: you will need to remount it with write permissions. Find out the name of the device or mount point, and do something like mount -o remount,rw / (this would be for the root filesystem). But you should also try to find out why it's mounted read only and remove that cause, because after a reboot it's likely to be back read only. –  Isaac Jul 5 '12 at 11:10

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.