Follow

linux, boots appreciated 

Does anyone know of a tutorial on how to set up a shell script to automatically FTP the updated files to your web server whenever you build a page? Copying and pasting by hand is tedious ageofdatini.info/essays/how-do

· · Web · 7 · 11 · 4

linux, boots appreciated 

@bookandswordblog sylvaindurand.org/deploying-a-

If you look for "static site upload" + "ftp" you'll probably find tons. rsync suggestion is a good idea if it works!

re: linux, boots appreciated 

@bookandswordblog idk about ftp, i just use rsync because it sends the files that changes and also can send parts of a file instead of the whole thing so its faster and also its just one command to upload stuff

rsync -r --progress the_folder_here username@domain.tld:destination_folder

re: linux, boots appreciated 

@bookandswordblog tho if that doesnt work immediately, you may need to install rsync on your server

re: linux, boots appreciated 

@potatoxel I will look into rsync although I am not sure if my web host supports it alldomains.hosting/faq-hosting They might be able to install it.

re: linux, boots appreciated 

@bookandswordblog goodluck c; about ftp idk, iused it in the past tho just by hand not command line

re: linux, boots appreciated 

@potatoxel yes, right now I SFTP in through my Ubuntu box's Files tool, but that involves too many repetitive clicks

linux, boots appreciated 

@bookandswordblog One option would be to use an addon for your IDE. An example for Sublime Text: github.com/NoxArt/SublimeText2

If you really want a script it could be just an one-liner: `ftp_client $host put $build_dir $www_server_dir`. It needs a client that you can pass commands to perform at connect.

But mostly I encourage you to switch from FTP to FTPS/SFTP/SCP/SSH for encryption (and SCP upload would be a one-line command).

linux, boots appreciated 

@dzwiedziu I'm almost sure it is SFTP since I have to log in to the server overseas. Did not know that Sublime Text can take addons to handle file upload! The site is built with shell scripts not in my text editor.

linux, boots appreciated 

@bookandswordblog ST is veeeeeery pluggable ^_^

Geographical location may not have anything to do with encryption, as someone may just not care about f.e. regulations.

But if it's SFTP it really should be one command (see `man sftp`): `sftp $host put $local-dir $remote-dir`.

linux, boots appreciated 

@dzwiedziu the address which I sent files to starts with ftp://ssl ... not sftp://... if that matters.

linux, boots appreciated 

@bookandswordblog Then it should be FTPS (which is something other than SFTP technically, but lets skip this).

For command usage this doesn't change much. Same commands and syntax for basic usage.

linux, boots appreciated 

@bookandswordblog you mean something like inotifywait? linux.die.net/man/1/inotifywai

linux, boots appreciated 

@Rocket new command-line tool to me! I think something like *curl*, *rsync*, or *ftp* at the end of the shell script in the linked post would be more suitable.

linux, boots appreciated 

@bookandswordblog rsync would be the right tool for syncing. Whether you glue it at the end of one script or let it run when inotifywait tells you to, depends of the situation.

linux, boots appreciated 

@bookandswordblog I have a Make (Makefile) script that does that with ssh, not ftp. Does that work for you?

Also some boots:

linux, boots appreciated 

@caranha excellent boots 12/10 would typo again

Sign in to participate in the conversation
Scholar Social

Scholar Social is a microblogging platform for researchers, grad students, librarians, archivists, undergrads, academically inclined high schoolers, educators of all levels, journal editors, research assistants, professors, administrators—anyone involved in academia who is willing to engage with others respectfully.