Difference between revisions of "Free Software Directory:Participate/MediaWiki"

From Free Software Directory
Jump to: navigation, search
(Estimate time for batch uploading)
 
(7 intermediate revisions by the same user not shown)
Line 9: Line 9:
 
* Add "administrator" group right to the "Maintenance script" user: http://directory.fsf.org/wiki?title=Special:UserRights/Maintenance_script
 
* Add "administrator" group right to the "Maintenance script" user: http://directory.fsf.org/wiki?title=Special:UserRights/Maintenance_script
  
* Evaluate the average time in seconds it will take to create or edit entries:
+
===Estimate time for batch uploading===
 
<pre>
 
<pre>
 +
script_generated=$(date +"%Y-%m-%d %H:%M:%S.%N"); # .wiki files with identical content since the last revision will be ignored by edit.php ("Your edit was ignored because no change was made to the text.")
 
SECONDS=0
 
SECONDS=0
# .wiki files with identical content since the last revision will be ignored by edit.php ("Your edit was ignored because no change was made to the text.") so add the current time in milliseconds to make them unique.
+
for (( i=0; i<10; i++ )); do
echo $RANDOM > Test.wiki; php /var/www/w/maintenance/edit.php -s "Some summary" Test0 < Test.wiki
+
  echo "$script_generated" > Test.wiki;
echo $RANDOM > Test.wiki; php /var/www/w/maintenance/edit.php -s "Some summary" Test1 < Test.wiki
+
  php /var/www/w/maintenance/edit.php -s "The edit summary" Test$i < Test.wiki
echo $RANDOM > Test.wiki; php /var/www/w/maintenance/edit.php -s "Some summary" Test2 < Test.wiki
+
done
echo $RANDOM > Test.wiki; php /var/www/w/maintenance/edit.php -s "Some summary" Test3 < Test.wiki
+
 
echo $RANDOM > Test.wiki; php /var/www/w/maintenance/edit.php -s "Some summary" Test4 < Test.wiki
 
echo $RANDOM > Test.wiki; php /var/www/w/maintenance/edit.php -s "Some summary" Test5 < Test.wiki
 
echo $RANDOM > Test.wiki; php /var/www/w/maintenance/edit.php -s "Some summary" Test6 < Test.wiki
 
echo $RANDOM > Test.wiki; php /var/www/w/maintenance/edit.php -s "Some summary" Test7 < Test.wiki
 
echo $RANDOM > Test.wiki; php /var/www/w/maintenance/edit.php -s "Some summary" Test8 < Test.wiki
 
echo $RANDOM > Test.wiki; php /var/www/w/maintenance/edit.php -s "Some summary" Test9 < Test.wiki
 
 
duration=$SECONDS
 
duration=$SECONDS
 
echo "$(($duration / 10)) seconds per entry in average."
 
echo "$(($duration / 10)) seconds per entry in average."
rm -f test.wiki
+
rm -f Test.wiki
 
</pre>
 
</pre>

Latest revision as of 16:28, 5 July 2018

maintenance/edit.php

To be able to create new pages with the maintenance/edit.php you need to do the following:

  • The "Maintenance script" doesn't exist by default. You can generate it by running something like:
echo "Hello" > test.wiki && php /var/www/w/maintenance/edit.php "A dummy editing just to generate the user account: Maintenance script" Sandbox < test.wiki

Estimate time for batch uploading

script_generated=$(date +"%Y-%m-%d %H:%M:%S.%N"); # .wiki files with identical content since the last revision will be ignored by edit.php ("Your edit was ignored because no change was made to the text.")
SECONDS=0
for (( i=0; i<10; i++ )); do
  echo "$script_generated" > Test.wiki;
  php /var/www/w/maintenance/edit.php -s "The edit summary" Test$i < Test.wiki
done

duration=$SECONDS
echo "$(($duration / 10)) seconds per entry in average."
rm -f Test.wiki


Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, no Front-Cover Texts, and no Back-Cover Texts. A copy of the license is included in the page “GNU Free Documentation License”.

The copyright and license notices on this page only apply to the text on this page. Any software or copyright-licenses or other similar notices described in this text has its own copyright notice and license, which can usually be found in the distribution or license text itself.