Search code examples
htmlftppublish

How to publish a web site via (linux) script


I'm just finished with a nice HTML5+ JQM web site on my Ubuntu laptop. A make script converts server side code to static HTML, optimizes images and compresses JTML, JavaScript and CSS.

I ask what's the method you'd suggest to upload it to my public server (I have an ftp access, no ssh). It should be a strong, repeatable and flexible (remove deleted files on server, upload only changed files, for example?) solution, which should be automated.


Solution

  • This is a generic solution which you need to modify for your needs

    • ls your changed files and save in an array(? or may be a list)
    • connect to FTP
    • upload changed content
    • disconnect

    Best would be to set up a versioning system that will cover the files deleted, modified etc. Set up GIT and use GIT commands to get a list of changed files and use command line FTP to upload files.