{"id":15595132,"url":"https://github.com/simonneutert/ruby-sftp-sync","last_synced_at":"2025-06-14T21:37:51.804Z","repository":{"id":82304140,"uuid":"117950017","full_name":"simonneutert/ruby-sftp-sync","owner":"simonneutert","description":"sync a directory with your webhoster (no deletion) - perfect for jekyll users with a simple webspace","archived":false,"fork":false,"pushed_at":"2025-02-01T18:50:37.000Z","size":14,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-05-09T00:52:09.373Z","etag":null,"topics":["command-line-tool","ftp","jekyll","ruby","sftp","ssh","sync"],"latest_commit_sha":null,"homepage":null,"language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/simonneutert.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-01-18T07:46:24.000Z","updated_at":"2025-02-01T18:50:00.000Z","dependencies_parsed_at":"2023-11-02T17:06:29.276Z","dependency_job_id":null,"html_url":"https://github.com/simonneutert/ruby-sftp-sync","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonneutert%2Fruby-sftp-sync","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonneutert%2Fruby-sftp-sync/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonneutert%2Fruby-sftp-sync/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/simonneutert%2Fruby-sftp-sync/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/simonneutert","download_url":"https://codeload.github.com/simonneutert/ruby-sftp-sync/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253171233,"owners_count":21865289,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["command-line-tool","ftp","jekyll","ruby","sftp","ssh","sync"],"created_at":"2024-10-03T00:43:13.275Z","updated_at":"2025-05-09T00:52:15.672Z","avatar_url":"https://github.com/simonneutert.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Push files to a server using sftp (and ssh)\n\nIn order to automate my Jekyll workflow, I thought about writing a bash script first. But why not use Ruby instead?\n\n__Inspiration__ was found __[here](https://www.infoq.com/articles/ruby-file-upload-ssh-intro), where Matthew Bass__ ([Matthew's GitHub](https://github.com/pelargir)) wrote a nice little article dated 2007. Though its simplicity made it easy to grasp, the script had some flaws. If you used an FTP client for your first upload, and the directories of your project would change or would never be deeper than one level - you are good to go. Yet my project had nested directories and thanks to progress, the gems wouldn't work quite the same as in the old days of 2007.\n\n\n# How to use?\n\nSimply load the __script__ and the __config.yml__ to the root of your application.\n\nSetup your Configuration in `config.yml`\n\n``` yaml\nhost_url: 'yourdomain.com'\nusername: 'xyz'\nlocal_path: './_site'\nremote_path: '/httpdocs/public_html'\nfile_perm: 0o644\ndir_perm: 0o755\n```\n\n\nThe following commands are implemented:\n\n* `$ ruby Upload2SFTP.rb upload [--config ./path-to-config.yml]`\n\n    uploads new files and directories\n\n* `$ ruby Upload2SFTP.rb clean [--config ./path-to-config.yml]`\n\n    deletes all files and subdirectories\n\n* `$ ruby Upload2SFTP.rb reupload [--config ./path-to-config.yml]`\n\n    deletes all files and subdirectories and resyncs\n\n* `$ ruby Upload2SFTP.rb remove [--config ./path-to-config.yml]`\n\n    deletes all files, subdirectories and root\n\n___\n\nrelies on the following gems, so either run `$ bundle` or:\n\n``` bash\n# https://github.com/net-ssh\n$ gem install net-ssh\n$ gem install net-sftp\n$ gem install commander\n```\n\n### Pull requests are welcome! :octocat:\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonneutert%2Fruby-sftp-sync","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonneutert%2Fruby-sftp-sync","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonneutert%2Fruby-sftp-sync/lists"}