Shell Script To Generate Mediawiki Wiki Software Google Sitemap

#!/bin/bash
# A Sample Shell Script To Generate Mediawiki Wiki Software Google Sitemap Using PHP
# on server itself via cron.
# Warning: You need to customize this script before using it!
# -------------------------------------------------------------------------
# Copyright (c) 2008 nixCraft project <https://www.cyberciti.biz/>
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
# Visit http://bash.cyberciti.biz/ for more information.
# -------------------------------------------------------------------------
 
# Path to wiki dir
BASE="/home/httpd/example.com/wiki"
 
# Wiki domain name
SERVER="http://www.example.com/"
 
# Path to actual sitemap file - change this 
OUT="${BASE}/sitemap-index-cbzwikibashportal.xml"
cd $BASE/wiki/maintenance
php generateSitemap.php --fspath="$BASE" --server="${SERVER}"
 
# patch it up replace example.com with actual domain name 
sed -i -e 's/sitemap-cbzwikibashportal-NS_[0-9]*-[0-9]*\.xml\.gz/http:\/\/www\.example\.com\/&/g' $OUT

Here is an updated version without need of using sed command:

#!/bin/bash
# Purpose: Shell Script To Generate Mediawiki Wiki Software Google Sitemap Using PHP
# -------------------------------------------------------------------------
# Copyright (c) 2017 nixCraft project <https://www.cyberciti.biz/>
# This script is licensed under GNU GPL version 2.0 or above
# -------------------------------------------------------------------------
# This script is part of nixCraft shell script collection (NSSC)
# Visit https://bash.cyberciti.biz/ for more information.
# -------------------------------------------------------------------------
 
## ATTENTION: Set me ##
# PHP cli path
_php=/usr/bin/php
# Path to script
_s=/var/www/html/wiki/maintenance/generateSitemap.php
# Memory limit 
_mem=50M
# Output folder
_fs=/var/www/html
# Given ID
_id=cbzwikibashportal
# Folder in which mediawiki installed
_url=https://bash.cyberciti.biz/wiki
# Wiki https url
_server=https://bash.cyberciti.biz
# Run it 
${_php} ${_s} --memory-limit=${_mem} --fspath=${_fs} --identifier=${_id} --urlpath=${_url} --server=${_server} --compress=yes
Get the latest tutorials on SysAdmin, Linux/Unix, Open Source, and DevOps topics:
CategoryList of Unix and Linux commands
File Management cat
Firewall Alpine Awall CentOS 8 OpenSUSE RHEL 8 Ubuntu 16.04 Ubuntu 18.04 Ubuntu 20.04
Network Utilities dig host ip nmap
OpenVPN CentOS 7 CentOS 8 Debian 10 Debian 8/9 Ubuntu 18.04 Ubuntu 20.04
Package Manager apk apt
Processes Management bg chroot cron disown fg jobs killall kill pidof pstree pwdx time
Searching grep whereis which
User Information groups id lastcomm last lid/libuser-lid logname members users whoami who w
WireGuard VPN CentOS 8 Debian 10 Firewall Ubuntu 20.04
0 comments… add one

Leave a Reply

Your email address will not be published. Required fields are marked *

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.