applescript routine for archiving appliance

Discussion in 'Mac Programming' started by cinemag, Jun 1, 2010.

  1. cinemag macrumors newbie

    Joined:
    Jun 1, 2010
    #1
    hello all,

    i am trying to automate the process of feeding files to a linux based network archiving appliance that writes tar archives. the problem is, if i drop a large load of files into it it writes a large tar archive that when restored takes forever.

    the trick is to segment the files, i.e. drop smaller loads thus producing smaller archives. the problem with that is you have to sit at a mac all day and do things by hand.

    i would like to know if anyone has a script that will check the arching device to see if the archiving directory is empty (the device is set to delete files once it has written them to tape) and if so moves another folder into it. so on and so on.

    thanks for any help or suggestions.

    john
     
  2. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #2
    How do you "drop" files to this device?

    How do you view the files in archiving directory?

    It seems like you should be able to do this with a shell script pretty easily if these things are accessible through "normal" file system checks.

    -Lee
     
  3. cinemag thread starter macrumors newbie

    Joined:
    Jun 1, 2010
    #3
    this is an LTO-4 based device. it contains a hard drive and mounts as a network share on windows or mac. when a tape is inserted it creates a directory or folder on the hard drive with the same name as the inserted LTO tape.

    you then drop files into this folder. it behaves like any other shared folder except that permissions are a little complicated and controlled by the device.

    it's by a company called cache-a and is a relatively new product.

    when you say shell script do you mean a unix shell as in terminal? are there any sites with examples that are editable?
     
  4. lee1210 macrumors 68040

    lee1210

    Joined:
    Jan 10, 2005
    Location:
    Dallas, TX
    #4
    There are ton of shell script examples out there. The hardest will be finding where in the filesystem these tapes get mounted. From there... You can test for presence of files with ls, copy things, etc.

    I'd break this into tasks:
    is archive directory empty?
    are there files to archive?

    If both are true:
    Copy N files to archive directory, quit.

    If either is false, quit.

    You can search for how to do any one of these and stick them together. I'd write something that does checks and copies one batch if the device is free. I'd then schedule this every N minutes.

    -Lee
     
  5. cinemag thread starter macrumors newbie

    Joined:
    Jun 1, 2010

Share This Page