0

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.

1 Answer 1

0

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .