Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Feb 2, 2007, 05:45 AM   #1
Isobel
macrumors newbie
 
Join Date: Feb 2007
Backup to server

Hi,
I'm new to AppleScript and I need to know how to backup all files in a folder to a shared network volume.

Can anyone help or point me in the right direction.

I need to find out how to:
- connect to a shared volume on a remote server,
- create a new folder on the shared volume,
- re-name it with the current date (preferrably formatted as YYYY-MM-DD),
- copy the contents of a local folder to it
- delete oldest folder on volume
- un-mount the volume

Any help at all would be very much appreciated.
Thanks
Isobel
Isobel is offline   0 Reply With Quote
Old Feb 2, 2007, 10:49 AM   #2
ChrisA
macrumors G4
 
Join Date: Jan 2006
Location: Redondo Beach, California
Quote:
Originally Posted by Isobel View Post
Hi,
I'm new to AppleScript and I need to know how to backup all files in a folder to a shared network volume.
Does this have to be done in AppleScript?

Is the network drive mounted before the script runs or does the script need to mount the network drive?
ChrisA is offline   0 Reply With Quote
Old Feb 2, 2007, 12:22 PM   #3
jeremy.king
macrumors 603
 
jeremy.king's Avatar
 
Join Date: Jul 2002
Location: Fox Lake, IL
Quote:
Originally Posted by ChrisA View Post
Does this have to be done in AppleScript?
Good point, I would think a shell script is a better idea.
jeremy.king is offline   0 Reply With Quote
Old Feb 7, 2007, 03:51 AM   #4
Isobel
Thread Starter
macrumors newbie
 
Join Date: Feb 2007
The files to be backed up are on a G5 iMac. I thought Applescript was the best way to go but I could be wrong (I'm a beginner here).

I would prefer it if the code mounted the drive IF it's not already mounted, then un-mount it at the end.

Should i be using a shell script instead?
Isobel is offline   0 Reply With Quote
Old Feb 8, 2007, 01:05 PM   #5
mbabauer
macrumors regular
 
Join Date: Feb 2006
Quote:
Originally Posted by Isobel View Post
The files to be backed up are on a G5 iMac. I thought Applescript was the best way to go but I could be wrong (I'm a beginner here).

I would prefer it if the code mounted the drive IF it's not already mounted, then un-mount it at the end.

Should i be using a shell script instead?
I would use a shell script for this. I believe OS X has NFS mounting capabilities, if not I know if has some version of Samba for SMB mounting a remote drive.

Either way, you would have to have the drive "shared" on the G5 side and available. Then, your shell script would:
- Check if the mount point was there (I would mount to /Volumes, as this seems to be the OS X standard...most non-Apple *nix variants use /mnt though), and mount it if its not. this is very simple to do.
- Backup the data. Again, fairly easy depending on what you deem "backup". The easiest would be to simple tar/gzip the contents you want to backup to the newly mounted share. Tar has some options to "tar to STDOUT" or "Untar from STDIN", allowing you to directly send the output of tar to gzip for a single-line TARBall creation.
- Possibly confirm the backup happened, maybe send an alert if a problem is detected.
- Unmount the share

Once the script is written, you could even go so far as to create an Automator script around it to schedule it, or add it to cron, or even just run it manually.

I would suggest getting a cheap book on the Bash shell to accomplish the script, or you can just use Google.
__________________
mbabauer
8-Bits me!
http://www.codechimp.net
mbabauer is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
thread Thread Starter Forum Replies Last Post
PowerMac G5 as a server? Good idea? alexreich PowerPC Macs 35 Sep 11, 2012 04:46 PM
Time Machine backups to FTP site? domzanghi Mac Applications and Mac App Store 1 Dec 13, 2011 11:12 AM
Building a (windows) home server, how to make TimeMachine backup to it? DaMan05 OS X 0 Jul 27, 2011 10:34 AM
Backup to Server adamvk OS X 3 Dec 10, 2009 03:49 PM
Using Time Machine to backup to windows server markfc OS X 1 May 7, 2008 11:10 AM


All times are GMT -5. The time now is 06:40 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC