Difference between revisions of "Shell Script: Untuk FTP"
Jump to navigation
Jump to search
Onnowpurbo (talk | contribs) |
Onnowpurbo (talk | contribs) |
||
Line 25: | Line 25: | ||
− | Jalankan di shell | + | Jalankan di [[shell]] dan di [[background process]] |
− | # ./myftp.sh | + | # ./myftp.sh & |
Tambahkan di crontab jika dibutuhkan | Tambahkan di crontab jika dibutuhkan |
Revision as of 17:43, 5 August 2009
Kadangkala kita membutuhkan untuk upload secara automatis menggunakan FTP. Shell Script berikut akan membantu,
Edit Script
# vi myftp.sh
isinya
#! /bin/sh REMOTE='namamesin' USER='namauser' PASSWORD='passworduser' FTPLOG='/tmp/ftplog' date >> $FTPLOG
ftp -n $REMOTE <<_FTP>>$FTPLOG quote USER $USER quote PASS $PASSWORD bin cd /myraid/dailyjpgs mput *.jpg quit _FTP
Jalankan di shell dan di background process
# ./myftp.sh &
Tambahkan di crontab jika dibutuhkan
# crontab -e