Mailinglist Archive: opensuse-wiki (395 mails)
| < Previous | Next > |
Re: [opensuse-wiki] Transferring images
- From: "Matthew Ehle" <mehle@xxxxxxxxxx>
- Date: Thu, 15 Jul 2010 00:30:06 -0600
- Message-id: <4C3E568E02000044000802F6@xxxxxxxxxxxxxxxxxxxxxxxxx>
Tim,
How are you determining which files you want to get? If it makes life easier
for you, I can just allow index view on files.opensuse.org, which I should
probably do anyway. With that, you can download all the files on
old-en.opensuse.org into one directory with a single wget command. That would
probably make it a lot easier for you to pick and choose the files you need.
I will look into getting one of these upload extensions installed as soon as I
get a handle on this session error bug that is affecting imports in the first
place. Since it is possible, however unlikely, that one of the new extensions
that we installed is related to the problem, I am wary of installing more
extensions until we at least know what is going on.
In any case, I'm going to go ahead and set index views on files.o.o before I go
to bed and forget all about it.
-Matt
on Mittwoch, 14. Juli 2010, Tim Mohlmann wrote:
to get the directory structure:
echo 'Image:foo.jpg' | sed 's/^Image://' | md5sum - | sed
's§^\(.\)\(.\).*§\1/\1\2§'
Script to download several images (not really tested, but should work):
grep ".." imglist.txt | while read file ; do
img=$(echo $file | sed 's/^Image://')
imgpath=$(echo "$img" | md5sum - | sed 's§^\(.\)\(.\).*§\1/\1\2§')
wget "http://old-en.opensuse.org/images/$imgpath/$img"
done
This will download all files listed in imglist.txt with wget.
imglist could look like that:
Image:Foo.jpg
Bar.jpg <---- Image: is not required (will be cut away anyway)
Image:Baz.jpg
I assume you know what you are writing into imglist.txt - the script
does not have a real protection against funny filenames etc.
Most important: you have to use _ instead of spaces (or add another sed ;-)
If you prefer to use commandline parameters instead of a file with the
filelist, replace the first line with
for file in "$@" ; do
Regards,
Christian Boltz
PS: In case you wonder: the "grep .." is a trick to skip empty lines ;-)
--
An NT server can be run by an idiot, and usually is.
[Tom Holub,a.h.b-o-u]
--
To unsubscribe, e-mail: opensuse-wiki+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-wiki+help@xxxxxxxxxxxx
--
To unsubscribe, e-mail: opensuse-wiki+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-wiki+help@xxxxxxxxxxxx
How are you determining which files you want to get? If it makes life easier
for you, I can just allow index view on files.opensuse.org, which I should
probably do anyway. With that, you can download all the files on
old-en.opensuse.org into one directory with a single wget command. That would
probably make it a lot easier for you to pick and choose the files you need.
I will look into getting one of these upload extensions installed as soon as I
get a handle on this session error bug that is affecting imports in the first
place. Since it is possible, however unlikely, that one of the new extensions
that we installed is related to the problem, I am wary of installing more
extensions until we at least know what is going on.
In any case, I'm going to go ahead and set index views on files.o.o before I go
to bed and forget all about it.
-Matt
Hello,Christian Boltz 07/14/10 4:35 PM >>>
on Mittwoch, 14. Juli 2010, Tim Mohlmann wrote:
I'm still try to work out a script for downloading multiple images at
once, to overcome the sub-directory problem. Tried earlier tips form
Rajko and Cristian, but it's not working as it should (wget is
following a little bit to much).
to get the directory structure:
echo 'Image:foo.jpg' | sed 's/^Image://' | md5sum - | sed
's§^\(.\)\(.\).*§\1/\1\2§'
Script to download several images (not really tested, but should work):
grep ".." imglist.txt | while read file ; do
img=$(echo $file | sed 's/^Image://')
imgpath=$(echo "$img" | md5sum - | sed 's§^\(.\)\(.\).*§\1/\1\2§')
wget "http://old-en.opensuse.org/images/$imgpath/$img"
done
This will download all files listed in imglist.txt with wget.
imglist could look like that:
Image:Foo.jpg
Bar.jpg <---- Image: is not required (will be cut away anyway)
Image:Baz.jpg
I assume you know what you are writing into imglist.txt - the script
does not have a real protection against funny filenames etc.
Most important: you have to use _ instead of spaces (or add another sed ;-)
If you prefer to use commandline parameters instead of a file with the
filelist, replace the first line with
for file in "$@" ; do
Regards,
Christian Boltz
PS: In case you wonder: the "grep .." is a trick to skip empty lines ;-)
--
An NT server can be run by an idiot, and usually is.
[Tom Holub,a.h.b-o-u]
--
To unsubscribe, e-mail: opensuse-wiki+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-wiki+help@xxxxxxxxxxxx
--
To unsubscribe, e-mail: opensuse-wiki+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-wiki+help@xxxxxxxxxxxx
| < Previous | Next > |