Shell Script: Untuk FTP

From OnnoWiki
Revision as of 14:48, 19 September 2009 by Onnowpurbo (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

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 



Pranala Menarik