Hi Guys,
My first post..
Right...I want to move existing files (with some date in their name) currently in
$mainftp, to
$mainfolder/$foldate/system1.
I'd like to be able to increment date in the
for loop? Is this possible or should I use a different technique.
The script return the following error
./movediselogs.sh: line 8: ((: foldate=070820: value too great for base (error token is "070820")
Hope that makes sense...
-----------------------
#!/bin/sh
startdate=`/bin/date --date="10 weeks ago" +%y%m%d`
currentdate=`/bin/date +%y%m%d`
mainfolder=/data/backup
mainftp=/ftp/upload/ftpsystem1
for ((foldate=$startdate; $foldate < $currentdate; foldate++))
do
mkdir $mainfolder/$foldate/system1
mv $mainftp/*$foldate* $mainfolder/$foldate/system1
done
-----------------------
Many Thanks
SunnyK