Linux - NewbieThis Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place!
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I have two servers on my network (at home). Let's call them A and B.
I have a small shell script that I have written on server A that zips up a file, backs up a database. It's triggered by cron once a day.
After I run it, I would like to move this file from server A to server B.
As I said, both are on the same network (in the same room, actually), and so obviously have different network IPs.
What are my options to move these files? It would need to be something that was done in perhaps a shell script that was, like the shell script that zips the files, is triggered by a cron job.
I'm assuming there are actual applications for this sort of theng (rsync?), but can it be done with a shell script? It seems very simple and basic...
I'm currently backing up my server as well with a small script that would copy the tar file to the other.
Here's the script:
# created date: November 09, 2009
# description: This script will backup files
# update:
######################################################################
There are indeed many ways. The big picture is this: you can choose to mount the remote volume, then just move or copy the file as you would copy it to another disk, using cp, mv, whatever. This can be done with nfs, sshfs, samba...
You can also choose to use a server-client model. In this case, you need to run a server in one of your machines, and launch the client in the other machine to literally upload your file to the server. This can be done usually with ssh (scp), ftp, rsync, and many other ways.
Both ways have advantages I guess, and often the line is thin. For example, if you have an ssh server running in your central machine, you can upload files to it by using either the scp file transfer tool, or by mounting the remote volume with sshfs and the using cp or mv to put the files inside the mounted share.
Last edited by i92guboj; 11-23-2009 at 07:13 PM.
Reason: typo
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.