Sync original script to shooting script

Those who have ever been on a film set know that the script may change a bit:
- dialogue,
- action,
- dropping a character who falls ill and is not critical for the story,
- dropping a scene due to budget / time constraints (overrun on budget)
AND is it CRITICAL to have the script updated for these changes.
IS THERE A WAY TO CONNECT THE SHOOTING SCRIPT AND THE ORIGINAL SCRIPT. Whoever has decided in the functionality of Adoby Story these 2 as seperate documents that do not sync has apparently never been to a film set before.
When will we be able to see the changes in one visible in the other?

OK, here is the other piece to it.  Now I am able to find and replace the IP and the Hostname however the IP gets written twice.
I am just curious if others think this would be helpful.
#!/usr/bin/perl
use strict;
use warnings;
use File::Find;
my $startdir = 'c:\ips-test';
my $find = 'host-ip 10\.1\.1\.101';
my $replace = 'host-ip 10.1.1.102';
my $find2 = 'host-name corpips01';
my $replace2 = 'host-name corpips02';
my $doctype = 'txt';
print qq~Finding "$find" and replacing it with "$replace" and "$find2" with "$replace2" \n~;
find(
   sub{
      return unless (/\.$doctype$/i);
      local @ARGV = $_;
      local $^I = '.bac';
      while( <> ){
         if( s/$find/$replace/ig ) {
            print;
          if( s/$find2/$replace2/ig ) {
            print;
         else {
            print;
}, $startdir);
print "Finished";

Similar Messages

  • Active Sync/lh script issue

    Hi there. We've recently rolled out IdM, and we're having some issues with Active Sync handlers. Specifically, when we set a handler to start up automatically, it seems to execute every time we run a script with the lh script command.
    That is to say, if we have a feed that's supposed to run at startup time, it executes when we run an lh script, then runs in the background until the lh script finishes, then dies when the script is over, which produces a number of error messages in the log.
    Is this known behavior? Is there a way we can prevent lh script from starting up activesync resources? Thanks.

    Hi,
    Please refer to the following forum to get professional support:
    Exchange Previous Versions-Mobility and ActiveSync
    http://social.technet.microsoft.com/Forums/exchange/en-US/home?forum=exchangesvrmobilitylegacy
    Thank you for your understanding and support!
    Best Regards,
    Amy Wang

  • Sync problem - Script error

    I use SharePoint 2013 online from Office 365. If I try to Sync a library to my local computer I get credential dialog at first. If I enter the login name I get script error. How can I workaround this problem?

    This error is not familiar with me.
    Can you gives some information on
    Browser version
    OS version
    Office version
    And If you are developer, please use F12 (Develop toolbar) to debug the script and see where it fails.
    Kind regards

  • FIM directory sync vs scripts

    Hi
    I'd like to get some feedback from those who have used this product before. We are investigating synchronising from 5 authoritative ADDS instances to a single AD LDS instance. I have demo'ed FIM and see some value in how it handles duplicates, reporting
    and so on. What we are after is simply a common LDAP directory that we can point applications to for basic contact information.
    Now FIM comes at a cost of around 18USD per CAL which isn't extortionate but also not cheap.  For you experts out there, what are some of the reasons one would motivate for using a tool like this versus ADSI scripts?

    The main advantage of the FIM Sync engine here is its 'hub-and-spoke' architecture which changes the game from coordinating 5 point-to-point sync processes to 6-spokes (connectors) and one central hub (metaverse or MV).  What does that give
    us?
    The 'connector space' (CS or staging area) allows us to define and enforce uniqueness rules and mandatory attribute presence (discovery errors);
    The hub gives us the ability to define join rules, projection rules, precedence and disconnection rules when records staged for each connected directory are compared to those already present in the central meta directory (MV);
    Synchronization rules between each CS and MV can enforce attribute precedence and identify ambiguity (synchronisation errors), and generate 'pending exports' to your downstream systems (in your case just ADLDS); and (most importantly)
    Full and Delta synchronization allows the initial establishment of a "baseline" (each CS in complete sync with the MV, and no pending exports unapplied to ADLDS) and subsequent efficient replication from each source AD of just the changes (deltas).
    By default synch cycles are run on a regular schedule - i.e. delta import/delta sync each of the 5 AD MAs to the MV, export the ADLDS MA, then delta import/delta sync of the ADLDS (confirming import).  If the flow is just in this direction then this
    cycle can be wound up to the point where replication SLAs are being met (e.g. every day/hour/15 minutes).
    Even better, with the addition of an affordable 3rd party tool these synchronisations can be run more efficiently to eliminate the need to define schedules or execution order - instead processing through FIM as and when changes occur in AD,
    and only to the relevant connectors.
    Compare this to the point-to-point options ... and work out how you would approach dealing with the above, and make it maintainable and supportable (1000s of these engines deployed world-wide if you take into account that this is embedded as an 'appliance'
    within SharePoint, as well as 'DirSync' deployments for O365).  That should be enough to provide a compelling argument to use FIM over scripts (if they are your 2 options).
    Bob Bradley (FIMBob @
    TheFIMTeam.com) ... now using FIM Event Broker for just-in-time delivery of FIM 2010 policy via the sync engine, and continuous compliance for FIM

  • SQL Server AlwaysON- Login Sync Utility/Script

    Team,
    We have a synchronous Always ON AG configured in our environment. I was looking for the best practices to have the logins sync if there are any additions. Also the way the application is configured is they have the ability to perform the db additions and
    sync them to AoAG group. However the challenge here is orphaned users.
    Can we make these databases contained databases on AlwaysON? If so please do recommend the best practices. 
    Thanks for your assist.
    Best Regards,
    Sharath

    Hi,
    Hope it helps.
    http://dba.stackexchange.com/questions/30036/how-to-link-users-and-logins-in-an-availability-group

  • Syncing original (CR2) and modified pictures of iPhoto 6 on two computers

    I've just faced a problem with iPhoto 6 and as I haven't found any good solution to it on Internet, I'd like to share with you all the solution I've finally applied.
    I'm using iPhoto 6 both on my MacBook and my iMac. When I'm travelling I shoot in Canon Raw 2 (CR2) format, upload my pictures to my MacBook, and, eventually, I edit them in some way. When I arrive at home, I'd like to sync my iMac with Macbook's iPhoto library (both the original CR2 file and the modified files in jpg). However, this turns out to not be so easy.
    I cannot just copy both the "iPhoto Library/Modified/YYYY/Rollname" and "iPhoto Library/Original/YYYY/Rollname" to iMac's iPhoto, because it isn't a file browser, but a database-based photo manager. If I import the "Original" folder with iPhoto and then copy the "Modified" folder with Finder, iPhoto won't recognise the modified picture, because according to its database that picture has never been edited.
    The solution I've used it's been to import the "Original" folder, so that CR2 files are put into iPhoto. Then, modify in some random way all the images that I had edited on my Macbook (easyly identificable without the "RAW" tag), so that iPhoto will know which pictures are modified but I don't have to take care with the editing, just modify something. Next step would be to copy Macbook's "Modified" folder to the iMac. And finally, I have to execute iPhoto while keeping Command + Option keys down and select the two first options (regenerate thumbnails).
    Hope this helps someone
    Miguel

    Welcome to the Apple Discussions.
    Well, easier might be to simply use iPhoto Library Manager to move the pics, all the versions and attached metadata between libraries.
    Standard warnng: Don't change anything in the iPhoto Library Folder via the Finder or any other application. iPhoto depends on the structure as well as the contents of this folder. Moving things, renaming things or otherwise making changes will prevent iPhoto from working and could even cause you to damage or lose your photos.
    Regards
    TD

  • Aperture to iPad syncing original, not adjusted

    Im pretty sure all setting are correct in previews as both top boxes are ticked, then "Always" and "half size" and on the Gear tab "Maintain Previews for Projects" has a tick next to it, Although it is greyed out when i click on a album.
    So I try and sync photo's though itunes and what i get is the original photo not the adjusted photo, which is pointless when im traverling and want to up date my blog.
    Thanks

    Maybe your Photo Cache is corrupted - I'd try to clear the Photo Cache as described here:
    iTunes: Understanding the iPod Photo Cache folder
    If this should not help, make sure the previews of your edited images are current - and if updating the previews does not help, you may need to repair your library; see the Aperture 3: Troubleshooting Basics on how to repair the permissions in your Aperture Library or to repair the database.
    Regards
    Léonie

  • Iphoto syncs original photo's to ipod only!!!

    I have synchronised my iPod Photo with iPhoto 7.01 (via itunes). To my suprise only the original photo's show up on my ipod. Older albums still had the modified photo's. But after removing them from the iPod and syncing all the albums again none of the albums had the modified pictures! In the webgallaries and iPhoto everything looks normal.
    What to do???
    Kind regards, Tom

    From iPhoto's help guide:
    To share a slideshow over the Internet:
    Select the photos you want in your slideshow. (You must select photos individually. For example, to select an entire album, select the album in the Source list, then choose Edit > Select All.)
    Choose Share > .Mac Slides.
    Click Publish.
    After your photos have been copied to your iDisk, click the Announce Slideshow button to tell other users how to view your slideshow.

  • Photos synced with iPhoto (through iTunes) ignore edits (syncs original)

    Not sure if this should go here, or in the iPhoto forum...
    I edited a batch of photos in iPhoto and put them in an Album. I setup iTunes to sync that Album with my iPhone. All the photos now appear on the phone, however the images on the phone are the "original" photos, not the edited versions that appear in the Album when viewing in iPhoto.
    So, the photos in the iPhoto Album are not the photos that get synched to my iPhone.
    Any ideas how to fix this?

    Intermittent problems are often a result of interference. Interference can be caused by other networks in the neighbourhood or from household electrical items.
    You can download and install iStumbler (NetStumbler for windows users) to help you see which channels are used by neighbouring networks so that you can avoid them, but iStumbler will not see household items.
    Refer to your router manual for instructions on changing your wifi channel or adjusting your multicast rate.
    There are other types of problems that can affect networks, but this is by far the most common, hence worth mentioning first. Networks that have inherent issues can be seen to work differently with different versions of the same software. You might also try moving the Apple TV away from other electrical equipment.

  • Syncing original white apple remote to 2010 mbp

    i have an old apple remote that i want to connect to my mbp through infrared but nothing happens when i try to sync it need help please!

    That's so odd, I tried the Apple Remote that came with my 13" 2007 Macbook with my i5 MBP and it worked without any fuss.

  • Panasonic DVX100 (original) should I shoot in 24p or 30p?

    Hey,
    Working on my first feature and will be editing in Final Cut Express HD 3.5. Want our dailies to look progressive scan and filmic should I shoot and edit in 30p?
    Chris

    I know for the most part you want progressive
    That's not necessarily true.  For Blu-ray or DVD delivery, 30i would be the better option over 30p or 60p, as 30i can go onto disk "as-is", without any frame rate conversions.
    I think the choice on this is purely aesthetic.  Do you want the look of film (24p) or the look of video (30i)?
    Personally, I shoot everything at 24 fps these days.

  • Multicam and multiple audio tracks sync issue, dual system shoot

    I've got a pesky problem with the multicam feature that has me stumped. I've got two cameras, slated with a clapboard, and one track of location sound recorded dual system on a seperate recorder. I have no matched TC on any of the tracks, got to use IN point only. I've tried making a merged clip for cam 1, then making the multiclip using the merged cam 1 clip and cam 2. The video of the multiclip is in sync fine, but the location sound (which is A3 on cam 1) is always offset and way out of sync.
    I've tried blowing away A1 and A2 from the cam 1 merged clip, putting the location sound at A1, and using that master clip to create the multiclip, but to no avail. Still out of sync
    It appears that because the location sound has a different start time in the merged clip than the video, FCP is getting confused about what to do with it.
    I've been successful with this method before, but the last time I had matched TC on the cameras. For some reason making the multiclip using the IN point for sync isn't working this time.
    Anyone encounter this and have a work around or solution?
    MacBookPro 2GhzDC 15"   Mac OS X (10.4.6)   Finla Cut Studio 5.1

    I've tried blowing away A1 and A2 from the cam 1 merged clip, putting the location sound at A1, and using that master clip to create the multiclip, but to no avail. Still out of sync< </div>
    Loyed's got way more experience with multicam than most of us so it's safe to follow his lead.
    Not knowing exactly what's going on (sorry if you've already tried this), I'd sync up the audio and then export the newly merged clip as a self-contained movie. Reimport.
    Hope you figure it out. Please return and post your solution for the benefit of those who come after seeking help with multiclips.
    bogiesan

  • Scripts not included in iCal sync?

    I am trying to sync calenders to my OSX server including events with scripts.
    The problem is when I subscribe to the calender I get the evenst but not attached scripts.
    What should I do to sync the scripts?

    It is well documented that the iPhone does not support ToDo lists, nor does it sync notes. Notes can be emailed, just not synced.
    It is very possible that this will be corrected in a future software upgrade, but as for now neither is possible.

  • Minecraft server script (run minecraft server as a daemon in Arch)

    Hey all, I just finished editing and setting up a nice script to run a Minecraft server at boot in Arch. This is based on the original script on the minecraft wiki here. I've edited it to be suitable to place in your /etc/rc.d/ folder with the name "minecraft" (/etc/rc.d/minecraft).
    This requires a user "minecraft" with the home directory /home/minecraft to work by default.
    I decided I wanted to run the server entirely in RAM so I store all my files in /home/minecraft/backup while the server is offline. When it starts up it makes a tmpfs mount at /home/minecraft/minecraft and copies all the files there and runs from there. It makes an hourly backup using /etc/rc.d/backup stored in /home/minecraft/onlinebackup, first erasing the current backup and creating a new one. This is simply to save space. In the event of a crash without proper stopping of the daemon you will have a backup from your previous reboot (or restart of your minecraft server) in /home/minecraft/backup and one from within the previous hour in /home/minecraft/onlinebackup which I figure ought to be enough. You can manually backup at any time by restarting the daemon.
    All paths can be altered. You can run this game under your normal user if you wish, just change the Settings section at the top of the file. RAM amounts may need to be increased for both the server and for the tmpfs, depending on how large your files are (mine are tiny and I have not heard of over 48MB for a game world, but you never know). Just check up on df -h every now and again to make sure your tmpfs has plenty of space, or just increase the allocated maximum size from the start. If you have low RAM you can always change the script to simply not use tmpfs.
    If anyone wants, just ask and I can put up a version without tmpfs (should be easy enough to remove yourself but if you're not sure I'll do it for you)
    All you need to start off with (if starting your server for the first time, using the scrip as is) is the user minecraft created, with the folders backup, onlinebackup and minecraft in the folder /home/minecraft, your minecraft_server.jar file in /home/minecraft/backup and your oninebackup file in /home/minecraft/backup.
    NOTE: onlinebackup file runs from /home/minecraft/minecraft so that if your system crashes, the cron job to run the backups will fail because the link will point to a non-existant file until server is started again.
    You can use these commands to with the server: /etc/rc.d/minecraft {start|stop|restart|update|backup}
    The backup system is designed to wipe all previous sessions' backups upon starting the server, so do not set it to start the server at boot.
    /etc/rc.d/minecraft
    #!/bin/bash
    # /etc/rc.d/minecraft
    . /etc/rc.conf
    . /etc/rc.d/functions
    #Uncomment line below if using Sun JRE
    #. /etc/profile
    #Settings
    SERVICE='minecraft_server.jar'
    USERNAME="minecraft"
    MCPATH='/home/minecraft/minecraft'
    MCOFFLINEPATH='/home/minecraft/backup'
    INVOCATION='java -Xmx768M -Xms768M -jar minecraft_server.jar nogui'
    BACKUPPATH='/home/minecraft/onlinebackup'
    ME=`whoami`
    as_user() {
    if [ "$ME" == "$USERNAME" ] ; then
    bash -c "$1"
    else
    su -c - $USERNAME "$1"
    fi
    mc_start() {
    stat_busy "Starting Minecraft Server"
    if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
    then
    echo "Tried to start but $SERVICE was already running!"
    else
    echo "$SERVICE was not running... starting."
    #Move minecraft from backup folder to ram
    mount -t tmpfs tmpfs -o size=50m $MCPATH
    cp -a $MCOFFLINEPATH/* $MCPATH
    echo "Files moved to RAM."
    cd $MCPATH
    as_user "cd $MCPATH && screen -dmS minecraft $INVOCATION"
    sleep 7
    if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
    then
    echo "$SERVICE is now running."
    #Create hourly backups while running
    ln -s $MCPATH/onlinebackup /etc/cron.hourly/minecraftonlinebackup
    echo "Hourly backups initiated."
    else
    echo "Could not start $SERVICE."
    umount $MCPATH
    fi
    fi
    add_daemon minecraft
    stat_done
    mc_saveoff() {
    if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
    then
    echo "$SERVICE is running... suspending saves."
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"say SERVER BACKUP STARTING. Server going readonly...\"\015'"
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-off\"\015'"
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-all\"\015'"
    sync
    sleep 10
    else
    echo "$SERVICE was not running. Not suspending saves."
    fi
    mc_saveon() {
    if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
    then
    echo "$SERVICE is running... re-enabling saves."
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-on\"\015'"
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"say SERVER BACKUP ENDED. Server going read-write...\"\015'"
    else
    echo "$SERVICE was not running. Not resuming saves."
    fi
    mc_stop() {
    stat_busy "Stopping Minecraft Server"
    if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
    then
    echo "$SERVICE is running... stopping."
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"say SERVER SHUTTING DOWN IN 10 SECONDS. Saving map...\"\015'"
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-all\"\015'"
    sleep 10
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"stop\"\015'"
    sleep 7
    if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
    then
    echo "$SERVICE could not be shut down... still running."
    else
    echo "$SERVICE is shut down."
    #Stop hourly backups
    rm /etc/cron.hourly/minecraftonlinebackup
    echo "Hourly backup halted."
    #Unmount tmpfs
    cp -a $MCPATH/* $MCOFFLINEPATH
    umount $MCPATH
    echo "Files copied to HDD."
    fi
    else
    echo "$SERVICE was not running."
    fi
    rm_daemon minecraft
    stat_done
    mc_update() {
    if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
    then
    echo "$SERVICE is running! Will not start update."
    else
    MC_SERVER_URL=http://minecraft.net/`wget -q -O - http://www.minecraft.net/download.jsp | grep minecraft_server.jar\</a\> | cut -d \" -f 2`
    as_user "cd $MCPATH && wget -q -O $MCPATH/minecraft_server.jar.update $MC_SERVER_URL"
    if [ -f $MCPATH/minecraft_server.jar.update ]
    then
    if `diff $MCPATH/minecraft_server.jar $MCPATH/minecraft_server.jar.update >/dev/null`
    then
    echo "You are already running the latest version of $SERVICE."
    else
    as_user "mv $MCPATH/minecraft_server.jar.update $MCPATH/minecraft_server.jar"
    echo "Minecraft successfully updated."
    fi
    else
    echo "Minecraft update could not be downloaded."
    fi
    fi
    mc_backup() {
    echo "Backing up minecraft world"
    if [ -d $BACKUPPATH/world_`date "+%m.%d.%Y"` ]
    then
    for i in 1 2 3 4 5 6
    do
    if [ -d $BACKUPPATH/world_`date "+%m.%d.%Y"`-$i ]
    then
    continue
    else
    as_user "cd $MCPATH && cp -r world $BACKUPPATH/world_`date "+%m.%d.%Y"`-$i"
    break
    fi
    done
    else
    as_user "cd $MCPATH && cp -r world $BACKUPPATH/world_`date "+%m.%d.%Y"`"
    echo "Backed up world"
    fi
    echo "Backing up the minecraft server executable"
    if [ -f "$BACKUPPATH/minecraft_server_`date "+%m.%d.%Y"`.jar" ]
    then
    for i in 1 2 3 4 5 6
    do
    if [ -f "$BACKUPPATH/minecraft_server_`date "+%m.%d.%Y"`-$i.jar" ]
    then
    continue
    else
    as_user "cd $MCPATH && cp minecraft_server.jar \"$BACKUPPATH/minecraft_server_`date "+%m.%d.%Y"`-$i.jar\""
    break
    fi
    done
    else
    as_user "cd $MCPATH && cp minecraft_server.jar \"$BACKUPPATH/minecraft_server_`date "+%m.%d.%Y"`.jar\""
    fi
    echo "Backup complete"
    #Start-Stop here
    case "$1" in
    start)
    mc_start
    stop)
    mc_stop
    restart)
    mc_stop
    mc_start
    update)
    mc_stop
    mc_backup
    mc_update
    mc_start
    backup)
    mc_saveoff
    mc_backup
    mc_saveon
    status)
    if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
    then
    echo "$SERVICE is running."
    else
    echo "$SERVICE is not running."
    fi
    echo "Usage: /etc/rc.d/minecraft {start|stop|update|backup|status|restart}"
    exit 1
    esac
    exit 0
    /home/minecraft/backup/onlinebackup
    #!/bin/bash
    # /home/minecraft/backup/onlinebackup
    rm -rf /home/minecraft/onlinebackup/*
    /etc/rc.d/minecraft backup
    UPDATE:
    rationalOgre has created an alternate script with a different backup system, which will keep compressed copies of your world indefinitely, along with a working update function. https://bbs.archlinux.org/viewtopic.php … 97#p944797
    Last edited by PIMPinator (2011-06-08 14:00:54)

    @PIMPinator - Weird. On mine, if I don't source /etc/profile it won't work. No clue what the difference is. I tested it after I got it up and running, removing different elements to see if one or the other was the problem. Without it all in place it just didn't work.
    I made some modifications to your script today. Fixed "update" so it works properly. (You had it running mc_backup after mc_stop, which never worked on my system.) I basically reworked it so it runs the backup, then stops the server and performs the update in the ~/backup directory, then restarts the server. I also completely overhauled the "backup" system. (for this to work you have to comment out the rm -rf ~/onlinebackup/* directive in the onlinebackup script.) Now, it creates 4 rolling backups of the server, in tar.gz format. What this means is that over time, you will accumulate the last 4 backups for each day in your ~/onlinebackup folder. I thought about creating a cleanup function to cull anything over 2 days old but to be honest, even if your world was > 50MB, zipped up it's going to be about ~20mb which means you can have 50 of them and only be taking up a gig of server space. Anyway, here's the code if you are interested.
    #!/bin/bash
    # /etc/init.d/minecraft
    . /etc/rc.conf
    . /etc/rc.d/functions
    #Comment out the following if using OpenJDK
    . /etc/profile
    #Settings
    SERVICE='minecraft_server.jar'
    USERNAME="minecraft"
    MCPATH='/home/minecraft/minecraft'
    MCOFFLINEPATH='/home/minecraft/backup'
    INVOCATION='java -Xmx768M -Xms768M -jar minecraft_server.jar nogui'
    BACKUPPATH='/home/minecraft/onlinebackup'
    ME=`whoami`
    as_user() {
    if [ "$ME" == "$USERNAME" ] ; then
    bash -c "$1"
    else
    su -c - $USERNAME "$1"
    fi
    mc_start() {
    stat_busy "Starting Minecraft Server"
    if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
    then
    echo "Tried to start but $SERVICE was already running!"
    else
    echo "$SERVICE was not running... starting."
    #Move minecraft from backup folder to ram
    mount -t tmpfs tmpfs -o size=50m $MCPATH
    cp -a $MCOFFLINEPATH/* $MCPATH
    echo "Files moved to RAM."
    cd $MCPATH
    as_user "cd $MCPATH && screen -dmS minecraft $INVOCATION"
    sleep 7
    if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
    then
    echo "$SERVICE is now running."
    #Create hourly backups while running
    ln -s $MCPATH/onlinebackup /etc/cron.hourly/minecraftonlinebackup
    echo "Hourly backups initiated."
    else
    echo "Could not start $SERVICE."
    umount $MCPATH
    fi
    fi
    add_daemon minecraft
    stat_done
    mc_saveoff() {
    if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
    then
    echo "$SERVICE is running... suspending saves."
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"say SERVER BACKUP STARTING. Server going readonly...\"\015'"
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-off\"\015'"
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-all\"\015'"
    sync
    sleep 10
    else
    echo "$SERVICE was not running. Not suspending saves."
    fi
    mc_saveon() {
    if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
    then
    echo "$SERVICE is running... re-enabling saves."
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-on\"\015'"
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"say SERVER BACKUP ENDED. Server going read-write...\"\015'"
    else
    echo "$SERVICE was not running. Not resuming saves."
    fi
    mc_stop() {
    stat_busy "Stopping Minecraft Server"
    if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
    then
    echo "$SERVICE is running... stopping."
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"say SERVER SHUTTING DOWN IN 10 SECONDS. Saving map...\"\015'"
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"save-all\"\015'"
    sleep 10
    as_user "screen -p 0 -S minecraft -X eval 'stuff \"stop\"\015'"
    sleep 7
    if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
    then
    echo "$SERVICE could not be shut down... still running."
    else
    echo "$SERVICE is shut down."
    #Stop hourly backups
    rm /etc/cron.hourly/minecraftonlinebackup
    echo "Hourly backup halted."
    #Unmount tmpfs
    cp -a $MCPATH/* $MCOFFLINEPATH
    umount $MCPATH
    echo "Files copied to HDD."
    fi
    else
    echo "$SERVICE was not running."
    fi
    rm_daemon minecraft
    stat_done
    mc_update() {
    if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
    then
    echo "$SERVICE is running! Will not start update."
    else
    MC_SERVER_URL=http://minecraft.net/`wget -q -O - http://www.minecraft.net/download.jsp | grep minecraft_server.jar\</a\> | cut -d \" -f 2`
    as_user "cd $MCOFFLINEPATH && wget -q -O $MCOFFLINEPATH/minecraft_server.jar.update $MC_SERVER_URL"
    if [ -f $MCOFFLINEPATH/minecraft_server.jar.update ]
    then
    if `diff $MCOFFLINEPATH/minecraft_server.jar $MCOFFLINEPATH/minecraft_server.jar.update >/dev/null`
    then
    echo "You are already running the latest version of $SERVICE."
    rm $MCOFFLINEPATH/minecraft_server.jar.update
    else
    as_user "mv $MCOFFLINEPATH/minecraft_server.jar.update $MCOFFLINEPATH/minecraft_server.jar"
    echo "Minecraft successfully updated."
    fi
    else
    echo "Minecraft update could not be downloaded."
    fi
    fi
    mc_backup() {
    echo "Backing up minecraft world"
    local COUNTER=
    if [ -f $BACKUPPATH/co ]
    then
    COUNTER=`cat $BACKUPPATH/co`
    if [ $COUNTER -gt 4 ]
    then
    #Loop back to 1 if greater than the max number of desired saves (4 hardcoded)
    as_user "echo 1 > $BACKUPPATH/co"
    COUNTER=1
    fi
    else
    COUNTER=1
    as_user "echo 1 > $BACKUPPATH/co"
    fi
    if [ -f $BACKUPPATH/world_`date "+%m.%d.%Y"`-$COUNTER.tar.gz ]
    then
    as_user "rm $BACKUPPATH/world_`date "+%m.%d.%Y"`-$COUNTER.tar.gz"
    fi
    as_user "cd $MCPATH && tar -czf $BACKUPPATH/world_`date "+%m.%d.%Y"`-$COUNTER.tar.gz world"
    #now to update the counter
    as_user "echo $(($COUNTER + 1)) > $BACKUPPATH/co"
    echo "Backup complete..."
    #Start-Stop here
    case "$1" in
    start)
    mc_start
    stop)
    mc_stop
    restart)
    mc_stop
    mc_start
    update)
    mc_saveoff
    mc_backup
    mc_saveon
    mc_stop
    mc_update
    mc_start
    backup)
    mc_saveoff
    mc_backup
    mc_saveon
    status)
    if ps ax | grep -v grep | grep -v -i SCREEN | grep $SERVICE > /dev/null
    then
    echo "$SERVICE is running."
    else
    echo "$SERVICE is not running."
    fi
    echo "Usage: /etc/rc.d/minecraft {start|stop|update|backup|status|restart}"
    exit 1
    esac
    exit 0
    I hope you don't mind.
    EDIT: Made a small change later that I came back and put in. If you are currently at the latest release it removes the .update file it created.
    Last edited by rationalOgre (2011-06-07 23:05:58)

  • Script to search all files in specified folder for multiple string text values listed in a source file and output each match to one single results txt file

    I have been searching high and low for this one.  I have a vbscript that can successfully perform the function if one file is listed.  It does a Wscript.echo on the results and if I run this via command using cscript, I can output to a text file
    that way.  However, I cannot seem to get it to work properly if I want it to search ALL the files in the folder.  At one point, I was able to have it create the output file and appear as if it worked, but it never showed any results when the script
    was executed and folder was scanned.  So I am going back to the drawing board and starting from the beginning.
    I also have a txt file that contains the list of string text entries I would like it to search for.  Just for testing, I placed 4 lines of sample text and one single matching text in various target files and nothing comes back.  The current script
    I use for each file has been executed with a few hundred string text lines I want it to search against to well over one thousand.  It might take awhile, but it works every time. The purpose is to let this run against various log files in a folder and
    let it search.  There is no deleting, moving, changing of either the target folder/files to run against, nor of the file that contains the strings to search for.  It is a search (read) only function, going thru the entire contents of the folder and
    when done, performs the loop function and onto the next file to repeat the process until all files are searched.  When completed, instead of running a cscript to execute the script and outputting the results to text, I am trying to create that as part
    of the overall script.  Saving yet another step for me to do.
    My current script is set to append to the same results file and will echo [name of file I am searching]:  No errors found.  Otherwise, the
    output shows the filename and the string text that matched.  Because the results append to it, I can only run the script against each file separately or create individual output names.  I would rather not do that if I could include it all in one.
     This would also free me from babysitting it and running each file script separately upon the other's completion.  I can continue with my job and come back later and view the completed report all in one.  So
    if I could perform this on an entire folder, then I would want the entries to include the filename, the line number that the match occurred on in that file and the string text that was matched (each occurrence).  I don't want the entire line to be listed
    where the error was, just the match itself.
    Example:  (In the event this doesn't display correctly below, each match, it's corresponding filename and line number all go together on the same line.  It somehow posted the example jumbled when I listed it) 
    File1.txt Line 54 
    Job terminated unexpectedly
     File1.txt Line 58 Process not completed
    File1.txt
    Line 101 User input not provided
    File1.txt
    Line 105  Process not completed
    File2.txt
    No errors found
    File3.txt
    Line 35 No tape media found
    File3.txt
    Line 156 Bad surface media
    File3.txt Line 188
    Process terminated
    Those are just random fake examples for this post.
    This allows me to perform analysis on a set of files for various projects I am doing.  Later on, when the entire search is completed, I can go back to the results file and look and see what files had items I wish to follow up on.  Therefore, the
    line number that each match was found on will allow me to see the big picture of what was going on when the entry was logged.
    I actually import the results file into a spreadsheet, where further information is stored regarding each individual text string I am using.  Very useful.
    If you know how I can successfully achieve this in one script, please share.  I have seen plenty of posts out there where people have requested all different aspects of it, but I have yet to see it all put together in one and work successfully.
    Thanks for helping.

    I'm sorry.  I was so consumed in locating the issue that I completely overlooked posting what exactly I was needing  help with.   I did have one created, but I came across one that seemed more organized than what I originally created.  Later
    on I would learn that I had an error in log location on my original script and therefore thought it wasn't working properly.  Now that I am thinking that I am pretty close to achieving what I want with this one, I am just going to stick with it.
    However, I could still use help on it.  I am not sure what I did not set correctly or perhaps overlooking as a typing error that my very last line of this throws an "Expected Statement" error.  If I end with End, then it still gives same
    results.
    So to give credit where I located this:
    http://vbscriptwmi.uw.hu/ch12lev1sec7.html
    I then adjusted it for what I was doing.
    What this does does is it searches thru log files in a directory you specify when prompted.  It looks for words that are contained in another file; objFile2, and outputs the results of all matching words in each of those log files to another file:  errors.log
    Once all files are scanned to the end, the objects are closed and then a message is echoed letting you know (whether there errors found or not), so you know the script has been completed.
    What I had hoped to achieve was an output to the errors.log (when matches were found) the file name, the line number that match was located on in that file and what was the actual string text (not the whole line) that matched.  That way, I can go directly
    to each instance for particular events if further analysis is needed later on.
    So I could use help on what statement should I be closing this with.  What event, events or error did I overlook that I keep getting prompted for that.  Any help would be appreciated.
    Option Explicit
    'Prompt user for the log file they want to search
    Dim varLogPath
    varLogPath = InputBox("Enter the complete path of the logs folder.")
    'Create filesystem object
    Dim oFSO
    Set oFSO = WScript.CreateObject("Scripting.FileSystemObject")
    'Creates the output file that will contain errors found during search
    Dim oTSOut
    Set oTSOut = oFSO.CreateTextFile("c:\Scripts\errors.log")
    'Loop through each file in the folder
    Dim oFile, varFoundNone
    VarFoundNone = True
    For Each oFile In oFSO.GetFolder(varLogPath).Files
        'Verifies files scanned are log files
        If LCase(Right(oFile.Name,3)) = "log" Then
            'Open the log file
            Dim oTS
            oTS = oFSO.OpenTextFile(oFile.Path)
            'Sets the file log that contains error list to look for
            Dim oFile2
            Set oFile2 = oFSO.OpenTextFile("c:\Scripts\livescan\lserrors.txt", ForReading)
            'Begin reading each line of the textstream
            Dim varLine
            Do Until oTS.AtEndOfStream
                varLine = oTS.ReadLine
                Set objRegEx = CreateObject("VBScript.RegExp")
                objRegEx.Global = True  
                Dim colMatches, strName, strText
                Do Until oErrors.AtEndOfStream
                    strName = oFile2.ReadLine
                    objRegEx.Pattern = ".{0,}" & strName & ".{0,}\n"
                    Set colMatches = objRegEx.Execute(varLine)  
                    If colMatches.Count > 0 Then
                        For Each strMatch in colMatches 
                            strText = strText & strMatch.Value
                            WScript.Echo "Errors found."
                            oTSOut.WriteLine oFile.Name, varLine.Line, varLine
                            VarFoundNone = False
                        Next
                    End If
                Loop
                oTS.Close
                oFile2.Close
                oTSOut.Close
                Exit Do
                If VarFoundNone = True Then
                    WScript.Echo "No errors found."
                Else
                    WScript.Echo "Errors found.  Check logfile for more info."
                End If
        End if

Maybe you are looking for