Go Back   The macosxhints Forums > OS X Help Requests > UNIX - General



Reply
 
Thread Tools Rate Thread Display Modes
Old 09-12-2003, 12:48 AM   #1
Teknyr
Prospect
 
Join Date: Mar 2002
Location: Utah
Posts: 9
Mounting a remote volume via Terminal

I am want to set up a daily back up of my machine. I plan to do this back up while I am asleep, 2 or 3 in the morning. The problem is the volume I want to back up to is my server.

The question is how do I mount a remote volume via command line. I know how to 'open' the volume using the command line, but it requests my password. Is it even possible to automate a login and logout of a remote volume?

The reason I want to know how to do this in command line is because I am using Cron to do the back up.

I would appreciate any help that can be given on this subject.
Teknyr is offline   Reply With Quote
Old 09-12-2003, 11:25 AM   #2
gatorparrots
Major Leaguer
 
Join Date: Dec 2002
Posts: 441
There are many possibilities. What's your preferred route: AFP, FTP, NFS, or WebDAV?
gatorparrots is offline   Reply With Quote
Old 09-12-2003, 11:56 AM   #3
breen
Major Leaguer
 
Join Date: Jan 2003
Location: Bay Area
Posts: 327
You don't really even need to mount the volume if you use rsync over ssh.

The basic command is

Code:
rsync -ae ssh /path/to/backup/  server:/path/to/backup/directory/
Just as I've written it you'll need to enter your password. You should set up ssh public keys to automate the login. If your workstation is secure you can set up a public key without a password to do the login, or see the keychain utility at

http://www.gentoo.org/proj/en/keychain.xml

which runs perfectly on OS X.

Breen
breen is offline   Reply With Quote
Old 09-15-2003, 08:51 AM   #4
acme.mail.order
League Commissioner
 
Join Date: Sep 2003
Location: Tokyo
Posts: 6,334
Plenty of unix file utilities like ftp, rsync and curl can read the .netrc file for machine names and passwords. If you don't need encrypted transport it's much easier than fussing with secure keys.

Read http://www.unet.univie.ac.at/aix/fil...iles/netrc.htm for a reasonably friendly description.
I use this for cron-scheduled copies with curl (type "man curl" in the terminal for details. Super-handy program for any unattended file movements between machines.)

Couple of points:
1. .netrc (starts with a period) must be at the top level of your home directory.
2. must be readable by you and you only (chmod 600)
3. it is invisible to the finder, which can be good or bad depending on your situation. If you like to use graphical tools to edit it, you can still type the full filename in the open dialog. Ignore the warnings when you save it, but make sure that your program doesn't add an extension.
4. Passwords are stored in clear text, you need to decide if that is acceptable or not
5. cron jobs must run as your user, not as system, or the right .netrc will not be found.
6. Each user may have a different file.
acme.mail.order is offline   Reply With Quote
Reply


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



All times are GMT -5. The time now is 10:43 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.