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/05/25 09:48]
andreas created
forum:inews:video-ids [2023/11/19 22:46] (current)
Line 1: Line 1:
 <- [[:​forum:​inews]] <- [[:​forum:​inews]]
 +
 +
  
 ====== Video IDs ====== ====== Video IDs ======
Line 33: 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 63: 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''​
Line 69: Line 74:
   - Macro - inside iNEWS Client as superuser   - Macro - inside iNEWS Client as superuser
     * In a keyboard story of your choice (normally the producer keyboard) assign the following macro to a key.\\ English version:<​code>​     * In a keyboard story of your choice (normally the producer keyboard) assign the following macro to a key.\\ English version:<​code>​
-{alt wo}hidden.video-ids{enter} {alt {right}{right}} {ctrl {home}} {shift {end}{left}} {ctrl x} {delete} {ctrl se} {alt wc} {alt {right}{right}{left}} {alt vuf}type-q{enter} {home} {tab} {f2} {space}{backspace} {ctrl v} {shift {end}} {ctrl x} {shift {home}} {ctrl v} {ctrl se} {alt vun} {home} {tab}{tab}</​code>​\\ German version:<​code>​ +{alt wo}hidden.video-ids{enter} {alt {right}{right}} {ctrl {home}} {shift {end}{left}} {ctrl x} {delete} {ctrl se} {alt wc} {alt {right}{right}{left}} {alt vuf}type-q{enter} {home} {tab} {f2} {space}{backspace} {home} {ctrl v} {shift {end}} {ctrl x} {shift {home}} {ctrl v} {ctrl se} {alt vun} {home} {tab}{tab}</​code>​\\ German version:<​code>​ 
-{alt fa}hidden.video-ids{enter} {alt {right}{right}} {ctrl {home}} {shift {end}{left}} {ctrl x} {delete} {ctrl se} {alt fs} {alt {right}{right}{left}} {alt abf}type-q{enter} {home} {tab} {f2} {space}{backspace} {ctrl v} {shift {end}} {ctrl x} {shift {home}} {ctrl v} {ctrl se} {alt abn} {home} {tab}{tab}</​code>​\\ French version:<​code>​ +{alt fa}hidden.video-ids{enter} {alt {right}{right}} {ctrl {home}} {shift {end}{left}} {ctrl x} {delete} {ctrl se} {alt fs} {alt {right}{right}{left}} {alt abf}type-q{enter} {home} {tab} {f2} {space}{backspace} {home} {ctrl v} {shift {end}} {ctrl x} {shift {home}} {ctrl v} {ctrl se} {alt abn} {home} {tab}{tab}</​code>​\\ French version:<​code>​ 
-{alt no}hidden.video-ids{enter} {alt {right}{right}} {ctrl {home}} {shift {end}{left}} {ctrl x} {delete} {ctrl se} {alt nf} {alt {right}{right}{left}} {alt hum}type-q{enter} {home} {tab} {f2} {space}{backspace} {ctrl v} {shift {end}} {ctrl x} {shift {home}} {ctrl v} {ctrl se} {alt hun} {home} {tab}{tab}</​code>​+{alt no}hidden.video-ids{enter} {alt {right}{right}} {ctrl {home}} {shift {end}{left}} {ctrl x} {delete} {ctrl se} {alt nf} {alt {right}{right}{left}} {alt hum}type-q{enter} {home} {tab} {f2} {space}{backspace} {home} {ctrl v} {shift {end}} {ctrl x} {shift {home}} {ctrl v} {ctrl se} {alt hun} {home} {tab}{tab}</​code>​
     * Test the macro. Save the keyboard story. Choose this keyboard in your preferences. Then go to a rundown story and press the related shortcut. If the story have had no video-id, now it should have the next one out of your list (and this number should be removed from the list). If the story have had a video-id before, this video-id should be there even if you run the macro. In that case nevertheless a number is removed from the list.     * Test the macro. Save the keyboard story. Choose this keyboard in your preferences. Then go to a rundown story and press the related shortcut. If the story have had no video-id, now it should have the next one out of your list (and this number should be removed from the list). If the story have had a video-id before, this video-id should be there even if you run the macro. In that case nevertheless a number is removed from the list.
 == Comments == == Comments ==
forum/inews/video-ids.1180086504.txt.gz · Last modified: 2023/11/19 22:45 (external edit)