User Tools

Site Tools


forum:inews:video-ids

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

forum:inews:video-ids [2007/06/27 14:52]
andreas Macros corrected!!!
forum:inews:video-ids [2023/11/19 22:46] (current)
Line 1: Line 1:
 <- [[:​forum:​inews]] <- [[:​forum:​inews]]
 +
  
  
Line 34: Line 35:
 # runs every morning at (via crontab) # runs every morning at (via crontab)
 # #
 +if /exc/ifis master
 +then
 +    LOGFILE=/​var/​log/​messages
 +    LOGDATE=$(date | cut -c5-19)
 +    DATE=$(date +%Y-%m-%d)
 +    ID=1
 +    DIGIT=00
  
-LOGDIR=/​var/​log/​iNEWS +    ​/​exc/​dbpurge hidden.video-ids 0 < /​site/​scripts/​yes2 > /dev/null 
-DATE=$(date +%c) +    rm /​site/​scripts/​video-ids/​data/​ids
-ID=1 +
-DIGIT=00 +
- +
-/​exc/​dbpurge hidden.video-ids 0 < /​site/​scripts/​yes2 > /dev/null +
-rm /​site/​scripts/​video-ids/​data/​ids+
  
-while test $ID -le 300 +    ​while test $ID -le 300 
-do +    do 
-    if test $ID -ge 10 +        if test $ID -ge 10 
-    then +        then 
-        DIGIT="​0"​ +            DIGIT="​0"​ 
-    fi +        fi 
-    if test $ID -ge 100 +        if test $ID -ge 100 
-    then +        then 
-        DIGIT=""​ +            DIGIT=""​ 
-    fi +        fi 
-    echo "​$(date +%d%m)-$DIGIT$ID"​ >> /​site/​scripts/​video-ids/​data/​ids +        echo "​$(date +%d%m)-$DIGIT$ID"​ >> /​site/​scripts/​video-ids/​data/​ids 
-    ID=$(expr $ID + 1) +        ID=$(expr $ID + 1) 
-done+    done
  
-/exc/doc -pu hidden.video-ids /​site/​scripts/​video-ids/​data/​ids +    ​/exc/doc -pu hidden.video-ids /​site/​scripts/​video-ids/​data/​ids 
-echo "​creating video IDs for" ​$DATE >> $LOGDIR/​video-ids</​code>​+    echo "$LOGDATE localhost $(basename $0): creating video IDs for $DATE" ​>> $LOGFILE 
 +fi</​code>​
     * Set permissions for video-ids.sh with<​code bash>     * Set permissions for video-ids.sh with<​code bash>
 chmod 744 /​site/​scripts/​video-ids/​video-ids.sh</​code>​ chmod 744 /​site/​scripts/​video-ids/​video-ids.sh</​code>​
Line 64: Line 68:
 /​site/​scripts/​video-ids/​video-ids.sh</​code>​ /​site/​scripts/​video-ids/​video-ids.sh</​code>​
     * Add an entry to roots crontab like<​code>​     * Add an entry to roots crontab like<​code>​
-35 5 * * * /​site/​scripts/​video-ids/​video-ids.sh > /dev/null 2&>​1</​code>​The leading two parameters specify the time when the script has to run (in our case 05:35). See the man-page for more information. Type ''​man crontab''​ to read this man-page. The last parameters after ''>''​ prevent some error messages to get printed. You should have an entry for ''​video-ids.sh''​ in the crontab of each iNEWS server. ​Differ the start time on both machines around about 5 or ten minutes. The best way is to run machine B first because in a dual system A is the (normally) master. Only on the master machine the dbpurge command inside the script takes effect. As a result the machine B first creates a new list story but can't remove the old one. Ten minutes (or whatever you write in the crontab of A) later on machine A the script removes the yesterday list as well as the list previously created on B and recreate the same list. In disaster case of single B system this machine then is also the master system and is able to remove the old list. At all with our crontab setup a daily new video-id-list is granted in all system states AB, A, B.((of course the start time for the script has to be early in the morning when nobody is working with the system. It will be a vulnerability,​ if a user picks up a video id between the script runs on B and then on A. This id is of course available again in the later created list from A.))+35 5 * * * /​site/​scripts/​video-ids/​video-ids.sh > /dev/null 2&>​1</​code>​The leading two parameters specify the time when the script has to run (in our case 05:35). See the man-page for more information. Type ''​man crontab''​ to read this man-page. The last parameters after ''>''​ prevent some error messages to get printed. You should have an entry for ''​video-ids.sh''​ in the crontab of each iNEWS server.
   - Type forms story - inside iNEWS Client as superuser((The macro can address the video-id-field just with ''​tabs''​. To avoid a disruption of its functionality by changing the rundown queue forms the macro works with its own queue view))   - Type forms story - inside iNEWS Client as superuser((The macro can address the video-id-field just with ''​tabs''​. To avoid a disruption of its functionality by changing the rundown queue forms the macro works with its own queue view))
     * Create a queue ''​system.forms.t.type-q''​     * Create a queue ''​system.forms.t.type-q''​
forum/inews/video-ids.1182955974.txt.gz · Last modified: 2023/11/19 22:45 (external edit)