Articles Comments

{ Berbagi, Menulis, Dan Mengajar } Ilmu… » 7. Operating System » .MoveData.sh

.MoveData.sh

#!/bin/bash
daerah=blitar;
cd /home/$daerah/public_html/
tglNow=`date “+%d%m%Y”`;
tglKmrn=`date +%d%m%Y -d “yesterday”`;
wktuNow=`date “+%H%M%d%m%Y”`;

echo “$tglNow”;
echo “$tglKmrn”;

Revisi=(R1 R2 R3 R4 R5 R6 R7 R8 R9 R10 R11 R12);

ls -al | grep 0342Blitar > .data.txt;
for file in $(cat /home/$daerah/public_html/.data.txt);
do mv “$file” /home/$daerah/OldData/ > /dev/null;
done;

cd /home/$daerah/public_html/Produksi/
ls -al | grep 0342Blitar > .data.txt;
for file in $(cat /home/$daerah/public_html/Produksi/.data.txt);
do
mv “$file” /home/$daerah/OldData/Produksi/$wktuNow.$file > /dev/null;
done;

Filed under: 7. Operating System

Leave a Reply

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>