============================
First of all:
These scripts work for me, and allow me to, say, go to sleep while they take care to replace old iso with the new, and unmount the old iso and free space, because I, as right now, am running jigdo download with all the iso jigdo and template files for my amd64 machine, and the sources...
...and, again, it works for me.
Sure if you're not amd64, modify the scripts to meet your own arch.
But above all, DON'T USE this if you will blame me for if anything goes wrong!
Responsability will only be your own!
Prerequisite: Old Jigdo downloaded ISO files from:
http://cdimage.debian.org/cdimage/weekl ... jigdo-dvd/
Last week's or last month's.
Or this week's if you will download those this week for the first time, but, sure, it will only make sense for you then to use this script next week.
No point using this script without old ISO files.
Create a directory Old in this directory where you will run these my scripts from.
$ mkdir Old
and move or copy from where you keep them, all the old ISO files into that directory.
Now here the scripts.
Put these in a separate user (yout) writeable directory. You will be running them from there.
They are:
jigdo-dl_01-jigdo-templ-t-s.sh
jigdo-dl_02-mnt-t-s.sh
jigdo-dl_03-dLo-SUMS.sh
jigdo-dl_04-dLo-t-s.sh
jigdo-dl_01-jigdo-templ-t-s.sh
Code: Select all
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-1.jigdo http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-1.template
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-2.jigdo http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-2.template
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-3.jigdo http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-3.template
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-4.jigdo http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-4.template
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-5.jigdo http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-5.template
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-6.jigdo http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-6.template
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-7.jigdo http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-7.template
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-8.jigdo http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-8.template
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-9.jigdo http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-9.template
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-10.jigdo http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-10.template
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-11.jigdo http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-11.template
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-12.jigdo http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/debian-testing-amd64-DVD-12.template
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/debian-testing-source-DVD-1.jigdo http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/debian-testing-source-DVD-1.template
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/debian-testing-source-DVD-2.jigdo http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/debian-testing-source-DVD-1.template
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/debian-testing-source-DVD-2.jigdo http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/debian-testing-source-DVD-2.template
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/debian-testing-source-DVD-3.jigdo http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/debian-testing-source-DVD-3.template
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/debian-testing-source-DVD-4.jigdo http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/debian-testing-source-DVD-4.template
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/debian-testing-source-DVD-5.jigdo http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/debian-testing-source-DVD-5.template
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/debian-testing-source-DVD-6.jigdo http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/debian-testing-source-DVD-6.template
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/debian-testing-source-DVD-7.jigdo http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/debian-testing-source-DVD-7.template
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/debian-testing-source-DVD-8.jigdo http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/debian-testing-source-DVD-8.template
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/debian-testing-source-DVD-9.jigdo http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/debian-testing-source-DVD-9.template
jigdo-dl_02-mnt-t-s.sh
Code: Select all
mkdir -p d-1 ; mount Old/debian-testing-amd64-DVD-1.iso d-1
mkdir -p d-2 ; mount Old/debian-testing-amd64-DVD-2.iso d-2
mkdir -p d-3 ; mount Old/debian-testing-amd64-DVD-3.iso d-3
mkdir -p d-4 ; mount Old/debian-testing-amd64-DVD-4.iso d-4
mkdir -p d-5 ; mount Old/debian-testing-amd64-DVD-5.iso d-5
mkdir -p d-6 ; mount Old/debian-testing-amd64-DVD-6.iso d-6
mkdir -p d-7 ; mount Old/debian-testing-amd64-DVD-7.iso d-7
mkdir -p d-8 ; mount Old/debian-testing-amd64-DVD-8.iso d-8
mkdir -p d-9 ; mount Old/debian-testing-amd64-DVD-9.iso d-9
mkdir -p d-10 ; mount Old/debian-testing-amd64-DVD-10.iso d-10
mkdir -p d-11 ; mount Old/debian-testing-amd64-DVD-11.iso d-11
mkdir -p d-12 ; mount Old/debian-testing-amd64-DVD-12.iso d-12
mkdir -p d-13 ; mount Old/debian-testing-source-DVD-1.iso d-13
mkdir -p d-14 ; mount Old/debian-testing-source-DVD-2.iso d-14
mkdir -p d-15 ; mount Old/debian-testing-source-DVD-3.iso d-15
mkdir -p d-16 ; mount Old/debian-testing-source-DVD-4.iso d-16
mkdir -p d-17 ; mount Old/debian-testing-source-DVD-5.iso d-17
mkdir -p d-18 ; mount Old/debian-testing-source-DVD-6.iso d-18
mkdir -p d-19 ; mount Old/debian-testing-source-DVD-7.iso d-19
mkdir -p d-20 ; mount Old/debian-testing-source-DVD-8.iso d-20
mkdir -p d-21 ; mount Old/debian-testing-source-DVD-9.iso d-21
Code: Select all
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/MD5SUMS
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/SHA1SUMS
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/SHA256SUMS
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/amd64/jigdo-dvd/SHA512SUMS
mv -iv MD5SUMS MD5SUMS-t
mv -iv SHA1SUMS SHA1SUMS-t
mv -iv SHA256SUMS SHA256SUMS-t
mv -iv SHA512SUMS SHA512SUMS-t
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/MD5SUMS
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/SHA1SUMS
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/SHA256SUMS
wget -nc http://cdimage.debian.org/cdimage/weekly-builds/source/jigdo-dvd/SHA512SUMS
mv -iv MD5SUMS MD5SUMS-s
mv -iv SHA1SUMS SHA1SUMS-s
mv -iv SHA256SUMS SHA256SUMS-s
mv -iv SHA512SUMS SHA512SUMS-s
dl in the names of the script is for d(own)l(oad), mnt for mount, t for testing s for source. Not important, but helps understand.jigdo-lite --scan d-1/ debian-testing-amd64-DVD-1.jigdo ; \
jigdo-lite --noask --scan d-2/ debian-testing-amd64-DVD-2.jigdo ; \
jigdo-lite --noask --scan d-3/ debian-testing-amd64-DVD-3.jigdo ; \
jigdo-lite --noask --scan d-4/ debian-testing-amd64-DVD-4.jigdo ; \
jigdo-lite --noask --scan d-5/ debian-testing-amd64-DVD-5.jigdo ; \
jigdo-lite --noask --scan d-6/ debian-testing-amd64-DVD-6.jigdo ; \
jigdo-lite --noask --scan d-7/ debian-testing-amd64-DVD-7.jigdo ; \
jigdo-lite --noask --scan d-8/ debian-testing-amd64-DVD-8.jigdo ; \
jigdo-lite --noask --scan d-9/ debian-testing-amd64-DVD-9.jigdo ; \
jigdo-lite --noask --scan d-10/ debian-testing-amd64-DVD-10.jigdo ; \
jigdo-lite --noask --scan d-11/ debian-testing-amd64-DVD-11.jigdo ; \
jigdo-lite --noask --scan d-12/ debian-testing-amd64-DVD-12.jigdo
jigdo-lite --noask --scan d-13/ debian-testing-source-DVD-1.jigdo ; \
jigdo-lite --noask --scan d-14/ debian-testing-source-DVD-2.jigdo ; \
jigdo-lite --noask --scan d-15/ debian-testing-source-DVD-3.jigdo ; \
jigdo-lite --noask --scan d-16/ debian-testing-source-DVD-4.jigdo ; \
jigdo-lite --noask --scan d-17/ debian-testing-source-DVD-5.jigdo ; \
jigdo-lite --noask --scan d-18/ debian-testing-source-DVD-6.jigdo ; \
jigdo-lite --noask --scan d-19/ debian-testing-source-DVD-7.jigdo ; \
jigdo-lite --noask --scan d-20/ debian-testing-source-DVD-8.jigdo ; \
jigdo-lite --noask --scan d-21/ debian-testing-source-DVD-9.jigdo ; \
Now I have a partition
Code: Select all
$ df -h
/dev/my_device 123G 111G 6.0G 95% /Cmn
$
Code: Select all
mr@naibd9:/Cmn/Debian$ ls -lh Old
total 86G
-rw-r--r-- 1 mr mr 4.4G Jan 6 15:31 debian-testing-amd64-DVD-10.iso
-rw-r--r-- 1 mr mr 4.4G Jan 2 21:33 debian-testing-amd64-DVD-11.iso
-rw-r--r-- 1 mr mr 446M Jan 2 21:43 debian-testing-amd64-DVD-12.iso
-rw-r--r-- 1 mr mr 3.8G Jan 6 11:37 debian-testing-amd64-DVD-1.iso
-rw-r--r-- 1 mr mr 4.3G Jan 6 11:52 debian-testing-amd64-DVD-2.iso
-rw-r--r-- 1 mr mr 4.4G Jan 6 12:10 debian-testing-amd64-DVD-3.iso
-rw-r--r-- 1 mr mr 4.4G Jan 6 12:29 debian-testing-amd64-DVD-4.iso
-rw-r--r-- 1 mr mr 4.4G Jan 6 12:42 debian-testing-amd64-DVD-5.iso
-rw-r--r-- 1 mr mr 4.4G Jan 6 12:57 debian-testing-amd64-DVD-6.iso
-rw-r--r-- 1 mr mr 4.4G Jan 6 13:20 debian-testing-amd64-DVD-7.iso
-rw-r--r-- 1 mr mr 4.4G Jan 6 14:06 debian-testing-amd64-DVD-8.iso
-rw-r--r-- 1 mr mr 4.4G Jan 6 14:42 debian-testing-amd64-DVD-9.iso
-rw-r--r-- 1 mr mr 4.4G Jan 2 22:02 debian-testing-source-DVD-1.iso
-rw-r--r-- 1 mr mr 4.4G Jan 2 22:24 debian-testing-source-DVD-2.iso
-rw-r--r-- 1 mr mr 4.4G Jan 2 22:47 debian-testing-source-DVD-3.iso
-rw-r--r-- 1 mr mr 4.4G Jan 2 23:14 debian-testing-source-DVD-4.iso
-rw-r--r-- 1 mr mr 4.4G Jan 2 23:53 debian-testing-source-DVD-5.iso
-rw-r--r-- 1 mr mr 4.4G Jan 3 00:37 debian-testing-source-DVD-6.iso
-rw-r--r-- 1 mr mr 4.4G Jan 3 01:18 debian-testing-source-DVD-7.iso
-rw-r--r-- 1 mr mr 4.4G Jan 3 02:32 debian-testing-source-DVD-8.iso
-rw-r--r-- 1 mr mr 3.1G Jan 3 02:55 debian-testing-source-DVD-9.iso
mr@naibd9:/Cmn/Debian$
Not anymore.
But I haven't yet given you the script that does the moving and unmounting and deleting at the right time, while I sleep!
Wait, it's two more scripts Here they come.
iso_check-del_00.sh
Code: Select all
#!/bin/bash
arrayMD5=(`cat MD5SUMS-bare`)
arrayDebNames=(`cat debian-DVD-list`)
for ((i=0; i <= "20" ; i++ ))
do
echo "$i"
echo ${arrayMD5[i]} ;
iR=${arrayMD5[i]}
echo "\$iR" ;
echo "$iR" ;
j="${arrayDebNames[i]}" ;
echo "\$j" ;
echo "$j" ;
jR=`md5sum $j|cut -d ' ' -f 1` ;
echo "\$jR" ;
echo "$jR" ;
# read FAKE ;
if [[ $iR == $jR ]] ;
then
k=`echo $i+1|bc`
echo "\$k" ;
echo "$k" ;
echo ;
echo ;
echo ;
echo ;
echo ;
echo ;
mv -v ${arrayDebNames[i]} Old/ ; umount -v d-$k ;
rmdir -v d-$k ;
df -h . ;
echo "Sleeping 2 minutes, usually even more to next mv..."
echo ;
echo ;
echo ;
echo ;
echo ;
sleep 120 ;
fi
df -h . ;
# read FAKE ;
done
echo "============================================================"
Now the final script.
Place this one in /usr/local/bin/
It could be done otherwise, but it's ok this way.
Oh, if I forget to write this where appropriate, let me tell you here, all the scripts certainly must be
Code: Select all
$ chmod 755 the_script
EDIT Fri Mar 14 09:56:16 GMT 2014 START
This below is not the run_CMD_00.sh! And then the whole idea will not work.
I have noticed this this very moment. Correction follows in today's post further down.
EDIT END
run_CMD_00.sh
Code: Select all
#!/bin/bash
arrayMD5=(`cat MD5SUMS-bare`)
arrayDebNames=(`cat debian-DVD-list`)
for ((i=0; i <= "20" ; i++ ))
do
echo "$i"
echo ${arrayMD5[i]} ;
iR=${arrayMD5[i]}
echo "\$iR" ;
echo "$iR" ;
j="${arrayDebNames[i]}" ;
echo "\$j" ;
echo "$j" ;
jR=`md5sum $j|cut -d ' ' -f 1` ;
echo "\$jR" ;
echo "$jR" ;
# read FAKE ;
if [[ $iR == $jR ]] ;
then
k=`echo $i+1|bc`
echo "\$k" ;
echo "$k" ;
echo ;
echo ;
echo ;
echo ;
echo ;
echo ;
mv -v ${arrayDebNames[i]} Old/ ; umount -v d-$k ;
rmdir -v d-$k ;
df -h . ;
echo "Sleeping 2 minutes, usually even more to next mv..."
echo ;
echo ;
echo ;
echo ;
echo ;
sleep 120 ;
fi
df -h . ;
# read FAKE ;
done
echo "============================================================"
Mon Jan 6 16:10:50 UTC 2014
Oh, no, I forgot more stuff.
The script needs two files to be in that directory you created as explained.
And pls see the post after next that I will write next, for how to crete those files.
They are, names hardwired in the script, debian-DVD-list and MD5SUMS-bare
and, maybe one more thing, if you change the number of ISO that you download, than the line:
for ((i=0; i <= "20" ; i++ ))
needs to reflect.that. 20 is for 21 files, 0 to 20.
EDIT END
Now I guess you need to peruse the scripts and see that they do simple tasks mostly.
I don't think there's much explanation on what
jigdo-dl_01-jigdo-templ-t-s.sh
jigdo-dl_02-mnt-t-s.sh
jigdo-dl_03-dLo-SUMS.sh
do.
Also
jigdo-dl_04-dLo-t-s.sh
is easy to understand.
Ah, I forgot:
https://wiki.debian.org/jigdo
Read there if you haven't yet, and, of course, install the jigdo-lite !
$ man jigdo-lite
And the moving and deleting and unmounting is done with:
run_CMD_00.sh
given above.
EDIT START Tue Jan 7 02:12:44 UTC 2014
"(and as root)" was needed to be added, mounting and things... can't do common user
EDIT END
In this way (and as root):
Code: Select all
$ run_CMD_00.sh 10000 60 ./iso_check-del_00.sh
I got to rush now. I hope someone can even improve on these scripts.
Pls, this is really not much, but consider them under GPLv3 or later licence. And don't disregard that I came up with this idea.
Miroslav Rovis
Zagreb, Croatia,
http://www.CroatiaFidelis.hr