linux - need input on a NCFTP shell script -


i trying create shell script uploads local directory tree remote server. part of code works fine. when add chmod command ncftp> shell.

can me out? code have:

    #!/bin/bash echo "afbeeldingen uploaden..." ncftpput -rvm -u "username" -p "password" domain.com /domains/domain.com/public_html/wp-content/gallery /shared\ items/beeld/lowres/* ncftp -u "username" -p "password" domain.com ncftp chmod -r 777 /domains/domain.com/public_html/wp-content/gallery/* quit echo "klaar!" exit 

it possible add chmod command ncftpput command directly.

the option -x can used execute command on each of uploaded files. here example single file should executable on server:

ncftpput -u "username" -p "password" domain.com \ -x "chmod 0755 /remotepath/hello_world" /remotepath /localpath/hello_world 

it possible use %s match each of uploaded files.

ncftpput -u "username" -p "password" domain.com \ -x "chmod 0755 %s" /remotepath localpath/* 

the option -d put.log helped me track problem down. seams local file path used %s. localpath , remotepath should related.

the documentation ncftpput available online, too: http://www.ncftp.com/ncftp/doc/ncftpput.html.


Comments

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -