Barusan iseng2 bantu teman bikin script pengcopyan file dgn kondisi tertentu. Berikut scriptnya :
# ee /etc/duplikat
cd /home/rahma/coba
lastfile=$(ls -rt | egrep -v '^d' | tail -20)
for file in $lastfile
do
echo $file
cp $file /home/rahma/coba2
done
Script diatas adalah script yang akan menjalankan duplikasi 20 file terbaru dari folder coba ke folder coba2.
Tinggal di pasang di crontab dan dijalankan sesuai dengan waktu yang diinginkan ^^.
copy file otomatis
script | Tuesday, March 25, 2008
This entry was posted on 12:53 PM
and is filed under
script
.
You can follow any responses to this entry through
the RSS 2.0 feed.
You can leave a response,
or trackback from your own site.
Subscribe to:
Post Comments (Atom)
1 komentar:
Saya tunggu di YM....
PENTING!!
Terima kasih.
Post a Comment