Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8394840
mw-export-category
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
927 B
Subscribers
None
mw-export-category
View Options
#!/bin/bash
# Copyright (C) 2015 Stefano Zacchiroli <zack@upsilon.cc>
# License: GNU General Public License version 3, or any later version
# Depends: rsync, wget
die_usage
()
{
echo
"Usage: export-category URL DESTDIR CATEGORY.."
exit
2
}
if
[
-z
"
$1
"
-o
-z
"
$2
"
-o
-z
"
$3
"
]
;
then
die_usage
fi
wiki_url
=
"
$1
"
;
shift
1
destdir
=
"
$1
"
;
shift
1
categories
=
"
$@
"
export_tmp
=
$(
mktemp
-td
tmp.mw_export.XXXXXXXXXX
)
url_list
=
$(
mktemp
-t
tmp.mw_urls.XXXXXXXXXX
)
trap
"rm -rf
$url_list
"
EXIT
mw-ls-category
--list-urls
--include-roots
--no-ssl-verify
\
"
$wiki_url
"
$categories
>
"
$url_list
"
wget
\
--span-hosts
\
--adjust-extension
\
--page-requisites
\
--convert-links
\
--no-check-certificate
\
--quiet
\
--directory-prefix
"
$export_tmp
"
\
--input-file
"
$url_list
"
echo
'Options +Indexes'
>
"
${
export_tmp
}
/.htaccess"
rsync
-au
--delete
--quiet
"
${
export_tmp
}
/"
"
${
destdir
}
/"
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Expires
Jun 4 2025, 7:30 PM (9 w, 4 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3375278
Attached To
rTMW MediaWiki tools
Event Timeline
Log In to Comment