Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

So I have this script I'm working on to try and copy a couple files to a windows server as a backup. It appears as though I am able to mount the share well enough, however I seem to be unable to copy the files to the share.

This is the script:

#!/bin/sh
mkdir /Volumes/BACKUP
mount_smbfs -f 777 -d 777 "//domain;domain\user:pass@server/backup" /Volumes/BACKUP
cp /Library/Application\ Support/path/to/file1 /Volumes/BACKUP
cp /Library/Application\ Support/path/to/file2 /Volumes/BACKUP
umount /Volumes/BACKUP 
rm -r /Volumes/BACKUP

This is what the terminal tells me:

computer:~/Desktop myuser$ ./Backup.sh
mount_smbfs: No credentials cache found krb5_cc_get_principal
cp: /Volumes/BACKUP/file1: Permission denied
cp: /Volumes/BACKUP/file2: Permission denied
computer:~/Desktop myuser$ 

I know there's a piece that I'm missing, I'm just not entirely to sure where.

share|improve this question

1 Answer 1

up vote 0 down vote accepted

I found the answer to my problem. Apparently using the username style of "DOMAIN\username" allows the share to be mounted, but not written to. I changed the script to account for this and it results in the following (simplified for more general use):

#!/bin/sh
mkdir /Volumes/BACKUP
mount_smbfs "//domain;user:pass@server/backup" /Volumes/BACKUP
cp /path/to/file1 /Volumes/BACKUP
cp /path/to/file2 /Volumes/BACKUP
umount /Volumes/BACKUP 
rm -r /Volumes/BACKUP

Hopefully this helps those that come after. ;D

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.