Saturday, September 5, 2009

share my two scripts which are using upload your file to client's server(via ftp or sftp)

Lately a guy complain that uploading his finished work files to client's server is not easy. sometimes to many files in anywhere dispersedly which is annoying to cover all files to upload completely.

Don't tell me you are still using WinSCP or Filezilla to upload files? if you are a developer then you should feel shame for what you are doing.

Let's see How do I solve this issue.
Firstly I wrote two scripts. as following:

FOR SFTP:

#!/bin/bash

curd=`pwd`

for i in $@; do
scp -P3122 -i /path/to/your/key $i jzhang@www.youclientserver.com:$curd/$i
done


FOR FTP(need ncftp):

#!/bin/bash

curd=`pwd`

for i in $@; do
d=`dirname $i`
ncftpput -uusername -ppasswd ftpdomain.com /footprint/${d//./ } $i
done


HOW TO USE:

$ svn status
? templates/ftp.php
M no_ie6_page.php

z33@gogocat /footprint
$ ~/upload_podbean.sh templates/ftp.php no_ie6_page.php

No comments:

Post a Comment