auto updating a script question (rsync or wget or ...?)
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.
auto updating a script question (rsync or wget or ...?)
i have a backup script that runs on hundreds of servers all over the US. id like to put it up on a central site (web page) and use either rsync or wget or some other function to have the servers check for an update. If there is a newer vs for their chain to grab the update, rename it, change the permissions to +x and move forward with the newer script.
I have no clue on even were to start on something like this.
The reason for the rename is although the script is basically the same there are slight changes like e-mail address, path, user/pw combo etc. This is a simple backup script for encrypting and then FTP data out to a local NAS. Each chain of stores has their own unique information.
on the server the script is named:
nasftp.sh (simple right)
on the web server id like to name it something along the line:
You are better off placing the backup file in a ftp server for both security and convenience measures:
then use ftp and use mget/get to grab the file to local server. Packages like gftp, ftp should work.
Ted
i was thinking about having the script check the web page for a vs difference and then grab it only if it is needed. this allows for better automation, vs manually pushing things down.
is that possible with mget or other ftp options? i have not done anything like either automated. so far as just pushing files around well that is the easy part.
yes absolutely, ftp can check last mod date to compare for a newer version. If you simply use wget to compare the difference, there may be concerns that you are comparing a newer copy to an older copy, overwriting the newer with a older one.
ahh nice, could you point me in a direction to do this with ftp as i currently have the files on a ftp server. i just have been manually downloading them to each server. takes way to long to log into server, log into ftp site and download file, verify the proper script is in place, log out, wash repeat for 100 stores in a day.
what dist are you using? And are your remote files placed in a ftp server? I probably need to get a bit more information to help you with the codes. (PM me if the credentials concern you)
Ted
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.