transfer the directory from one server to another server with a cron job
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.
transfer the directory from one server to another server with a cron job
Hi All,
I would like to request any idea about my problem. I would like to transfer the directory from one server to another server with time schedule such as cron job. My Distro is CentOS 7. Eg. I would like to transfer the directory from one server to another server at every 10 minute. Any idea? Really appreciate for yours kindly suggestions.Thank you.
You can copy the directory with rsync or scp. You don’t say it, but I think you want the two directories synchronized. If so, raync is the better solution, as it only copies the files that are different.
Hi All,
I would like to request any idea about my problem. I would like to transfer the directory from one server to another server with time schedule such as cron job. My Distro is CentOS 7. Eg. I would like to transfer the directory from one server to another server at every 10 minute. Any idea? Really appreciate for yours kindly suggestions.Thank you.
I would first suggest you read the "Question Guidelines" and "How to ask a smart question" links in my posting signature. A subject of "Help Me !!!" tells no one anything about your question. And there are many other threads you can find with a brief search that are almost identical to yours, that have solutions. And providing details about your environment helps too.
Using rsync could also easily be done, since that could also work over SSH, and that would probably be the first thing to investigate. Again, you don't provide details such as how much data, speed of the link between the systems, how much is going to change in those ten minutes, etc., etc....hard to give a good suggestion. But rsync is where I'd start.
You can copy the directory with rsync or scp. You don’t say it, but I think you want the two directories synchronized. If so, raync is the better solution, as it only copies the files that are different.
You can do that every 10 minutes with cron.
Thank you, I want to synchronized two directory. How about for Cron config? please could you show me the sample command? Appreciate for your kindly reply.
I would first suggest you read the "Question Guidelines" and "How to ask a smart question" links in my posting signature. A subject of "Help Me !!!" tells no one anything about your question. And there are many other threads you can find with a brief search that are almost identical to yours, that have solutions. And providing details about your environment helps too.
Using rsync could also easily be done, since that could also work over SSH, and that would probably be the first thing to investigate. Again, you don't provide details such as how much data, speed of the link between the systems, how much is going to change in those ten minutes, etc., etc....hard to give a good suggestion. But rsync is where I'd start.
Hi Mr.TB0ne,
I have two server. 1st one server is existing server and 2nd server is the new installed.
1.I would like to transfer my 1st one server's directory such as /root/Server1_Data to my 2nd server's under /root Directory at every 10 minute.
2.Transfer Data size is 500 MB and speed of link between two server is 1Gbps.
3. There are two different network within the LAN.
if you wish to use rsync you could start with the man page, you could find an example inside.
Otherwise all what you need is available on the net as examples or tutorials, you can choose your preferred way.
(Here, at LQ we used to say we won't google it for you).
Thank you, I want to synchronized two directory. How about for Cron config? please could you show me the sample command? Appreciate for your kindly reply.
Your crontab should contain
Code:
* * * * 10 rsync ...
(or perhaps one more asterisk?)
Also, use man crontab. For rsync, you find numerous tutorials on the internet, including one by the auther, Andrew Tridgell.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.