Follow us on...
Follow us on Twitter Follow us on Facebook
Register
Page 1 of 2 12 LastLast
Results 1 to 8 of 9
  1. #1
    twyg's Avatar
    twyg is offline Back to Mac Baby!
    Join Date
    Sep 2001
    Location
    NYC by day, Hudson Valley by night
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Fairly complicated, but there must be a way.

    Ok, here's the situation.

    I have 10 macs in a LAN setting. 7 of those macs are running 10.1.
    One machine acts as the "server" where AppleTalk is turned on, and everyone drops their files there. The current situation requires me to go once a week from mac to mac with a Firewire CD-R drive, and go through what the user wants backed up. Usually to expedite the process I just do a sherlock find file on files that have been modified in the past week through VNC. I also have remote login turned on for those machines running X. (For troubleshooting from my cubicle on stupid stuff like "I can't delete my trash because it says it's in use!?")

    Ok, so here's what I want. I want on Friday night for my machine to "run" from computer to computer on the network, pull the data modified in the past week to the "server" excepting files larger than say 50MB, tar and gzip all newly modified files from all machines into their own respective folders, and take all the folders and burn them to a CD I've already prepped for the purpose. *whew*

    Normally I would buy Timbuktu or a like program, however I work for a non-profit which means $1 or $2 a month spending allowance for the tech department.

    I know that cron jobs have a lot to do with this type of task, and I certainly will be more than happy to get a number of answers, and string it together myself. i.e. you know how to do the remote login, and copying with cron, but not how to find a file modified in the past week that is under 50MB. No sweat, I just would like to get something in place to resolve this issue sooner rather than later.

    Thanks, and whoever solves this one for me I owe a brewski. (or a soda should the circumstances require it)

    (just realized this is in the wrong forum, sorry jdog!)
    Last edited by twyg; December 5th, 2001 at 02:17 PM.
    Twyg

    To laugh often and much; to win the respect of intelligent people and the affection of children...to leave the world a better place...to know even one life has breathed easier because you have lived. This is to have succeeded.
    - Ralph Waldo Emerson

  2. #2
    scruffy's Avatar
    scruffy is offline Notorious Olive Counter
    Join Date
    Dec 2000
    Location
    Soviet Canuckistan
    Posts
    1,726
    Thanks
    0
    Thanked 0 Times in 0 Posts

    nowhere near a complete answer...

    But here are a couple of things to consider.

    tar drops resource forks. This is quite likely not what you want. There is a program out there called hfspax that I guess basically functions like pax (a poor cousin to tar, I gather), except that it respects resource forks and finder flags.

    You could use a cron job on each computer mount (see man mount, obviously) the afp server disk, then use hfspax to make a new pax.gz file of each user's home directory on the server. For the format of the crontab file, try 'sudo crontab -e' which will start up your default editor to edit root's crontab.

    For checking the size and age of files, try the man page for test - you can do at least things like (using /bin/sh syntax):

    if [ file1 -ot file2 ]
    then
    stuff to do if file1 is older than file2
    fi

    Do you really need to burn the backups if the files are already on the server? If so, try hdiutil, it has some options for CD burning.

    Sorry no full answers to any of this, but hopefully some of this will be useful to you.

    What is the robbing of a bank compared to the founding of a bank?
    -- Bertold Brecht

  3. #3
    blb
    blb is offline `'
    Join Date
    Apr 2001
    Location
    CO, USA
    Posts
    651
    Thanks
    0
    Thanked 0 Times in 0 Posts
    To find the files you're looking for, this find command should do the trick:

    Code:
    find / \( \! -fstype local -or -fstype fdesc -or -fstype kernfs \) -and -prune -or \( -type f -and -mtime -7 -and -size -50000000c -and -print \)
    It only runs against local filesystems, looks for only files modified in the last seven days, and less than 50,000,000 bytes in size. If you don't want to do it against the entire system, change the / to the point you're interested in (like /Users).

  4. #4
    twyg's Avatar
    twyg is offline Back to Mac Baby!
    Join Date
    Sep 2001
    Location
    NYC by day, Hudson Valley by night
    Posts
    584
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No apologies necessary, this is getting me on the right track.

    So, before I destroy all hopes of doing this nicely, let me show you how I've interpreted the info I've recieved.

    For a cron job I'll go sudo crontab -e
    I've got a hang up here, as I don't know jack didley about Cron coding. So where is a good place to get info?

    blb, Rockin! That code does the precise look-up job I wanted. I don't mind picking up all the .plist info, nor the .DS_store so it works great as is.

    This now steps back to the crontab edit. How do I tell the job to take the search results, and pull them into a tar? (or pax file for that matter, but I don't mind the resource fork problem.)

    This is kind of a quick and dirty, and if it doesn't show off the power of OS X I don't know what does. This will look very favorable to the PC people on the board who can't understand for the life of them why we use Macs as full blown business machines. (Or how.)

    I really appreciate the depth of the answers, thank you! (Note the lack of the sarcastic smiley, I do genuinely mean that )

    ** Update - I've found a good tutorial on cron, but am still looking for assistance from the experienced folks I'm not a lazy kinda guy, but sure, I'll take a magic bullet.
    Last edited by twyg; December 6th, 2001 at 10:13 AM.
    Twyg

    To laugh often and much; to win the respect of intelligent people and the affection of children...to leave the world a better place...to know even one life has breathed easier because you have lived. This is to have succeeded.
    - Ralph Waldo Emerson

  5. #5
    blb
    blb is offline `'
    Join Date
    Apr 2001
    Location
    CO, USA
    Posts
    651
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The largest problem I see is spaces; specifically spaces in all those filenames. On a non-space-using Unix, you could do something like

    Code:
    tar cf backup.tar `find ... -print`
    (the find obviously being chopped down). This works nicely as the output from find is a simple list of files. But as soon as one of those files has a space, that file won't be picked up (as it is taken as two files). Maybe some kind of perl-based wrapper is needed for this part?

  6. #6
    rharder's Avatar
    rharder is offline Do not read this sign.
    Join Date
    Mar 2001
    Location
    Virginia, USA
    Posts
    1,189
    Thanks
    0
    Thanked 3 Times in 3 Posts
    Another thing to think about is the file permissions. By default you won't be able to read other users' Home folders, but you might be able to make 'backup' group or something that gives you access.

    You can also use ssh and scp to access the files on other users' drives (with the permissions issue settled). You could run a script on each computer remotely (with ssh) that runs hfspax locally and then scp's it back to your server where your server can do what it likes with them.

    Just a thought...

    You might also look into some of the traditional unix backup tools like Amanda (http://www.amanda.org), but I don't know if you can make them work with hfspax, and it might be fairly complicated for someone to learn quickly.

    -Rob

  7. #7
    mrjohns is offline Registered User
    Join Date
    Mar 2001
    Posts
    22
    Thanks
    0
    Thanked 0 Times in 0 Posts

    In a unix world

    In a unix world there exists a tool called rsync. rsync keep file systems in sync across ssh connections. You can use it to take files modified from a specific date. Good stuff check it out. a simple cron job running once a night you can do a backup with the minimum of effort. (i.e sticking a CD in the drive and draging a file to the CD and burning it)

  8. #8
    scruffy's Avatar
    scruffy is offline Notorious Olive Counter
    Join Date
    Dec 2000
    Location
    Soviet Canuckistan
    Posts
    1,726
    Thanks
    0
    Thanked 0 Times in 0 Posts
    The above mentioned space problem might not actually be one. The man page for pax (I don't have hfspax installed to check) seems to indicate it can handle that:

    -w Write files to the standard output in the specified archive format. When no file operands are specified, standard input is read for a list of pathnames with one per line without any leading or trailing <blanks>.

    so you could maybe just pipe the find command's output to hfspax.

    That said, looking at the man page for rsync, it seems designed to do just what you are describing. Might just be the way to go. The only problem might be how to get all the backups down to one CD-R size.

    Would RAID be out of the question? OS X has (minimal) RAID support - enough for mirroring, so that if you could scrounge a couple extra HDs for your AFP server's shared directory, you could effectively immunize yourself from drive crashes. I understand you are on a tight budget and all...
    Last edited by scruffy; December 7th, 2001 at 03:12 PM.

    What is the robbing of a bank compared to the founding of a bank?
    -- Bertold Brecht

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. A complicated Chimera question
    By ksignorini in forum Mac OS X System & Mac Software
    Replies: 1
    Last Post: September 26th, 2002, 11:34 PM
  2. If you are a fairly experienced mac'er, would OS X confuse a lot?
    By RPS in forum Mac OS X System & Mac Software
    Replies: 23
    Last Post: July 6th, 2002, 07:00 AM
  3. No Floppy Drive Support in OS X??
    By Nachohat in forum Mac OS X System & Mac Software
    Replies: 24
    Last Post: November 26th, 2001, 07:11 AM
  4. Printing - complicated
    By HNick in forum Mac OS X System & Mac Software
    Replies: 0
    Last Post: November 20th, 2001, 08:06 PM
  5. OSX is WAY too complicated!
    By g3pro in forum Mac OS X System & Mac Software
    Replies: 0
    Last Post: November 10th, 2000, 07:44 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •