Remote File Modifier / FTP
Thursday, August 13, 2009 21:48I read somewhere once that for ideas you should look to what monotonous tasks you can automate, which is how this idea started to formulate. A co-worker, Bill, and I are putting in multiple trixbox based phone systems and are coming across allot of tweaks as we go that need to be pushed across multiple servers. By the time this idea becomes a reality we may be done or I back to school. However, through doing something like this it will allow me to learn new skills and get a better understanding of other concepts, such as how to communicate with through my program over a network/internet that I can apply to future programs. While he and I were talking Bill mentioned how it would be nice if there was a program that could do something along the following:
- read the server ip address, remote file location, file name, line number (where data is to be inserted after, since all same, make it first entry in file) to be accessed from a file (for multiple servers, so say, 1 per line)
- if just one server allow above information to be entered in program (NOT read from file)
- search and replace
- make the change and copy the file back to the server
- save a local copy with the server name/IP (some sort of identification) & timestamp in the file name, allows you to roll back to previous version
- option to insert a single line, overwrite file, replace line
Future enhancements:
- make program a full FTP app
- text editor capability
Bill says:
November 11th, 2009 at 12:41 AM
Rather than ftp, use scp or rsyc or something, so it can be copied anywhere on the destinaion server, not just to the ftp folder….
Hows this going anyways?
Devin says:
November 11th, 2009 at 10:21 AM
Well, since I am in school, I don’t have much time for working on personal projects, so not all that well at the present moment in time, lol. One of the bigger challenges, for me, on this projeect will be learning how to actually implement scp or rsync to actually connect and transfer files between the server and client. But that is the whole point of projects anyways, just need the key word time, which won’t come until I am on a break from school sometime, most likely, and unfortunately as I typicall have a big itch to work on my personal projects sometiems.
Devin says:
July 6th, 2010 at 5:25 PM
I may have just had a brain wave (though not sure how fruitful) while doing some work here. And that is a smaller scale of this idea. Essentially create a java app that uses a command line scp client for windows (http://the.earth.li/~sgtatham/putty/latest/x86/pscp.exe) provided by the creators of putty. The GUI will allow you to select the necessary options the program provides and enter your user name and password (perhaps once if all the same or read from a file if not). It could then read the server ip address and remote file location (similar to the original post) from a file. Then generate a Windows Batch file to be run, or run it directly and display the output in a window.
Not sure if this part is doable, but could perhaps some way make it so you can directly copy from one server to the other. Sounds a bit like RSYNC, but haven’t had a chance to tinker with that… got lots of projects on the go, lol.