Posted on 03-12-2014 11:54 PM
hi guys,
seems like a easy one but i cant seem to figure out.
so i've got ARD to map a network drive and try to copy some files like below:
rsync /Volumes/ServerName/Apps/Drivers/file.dmg /Library/Printers/PPDs/Contents/Resources/
the drive maps fine but fails at copying with the following error:
rsync: link_stat "/Volumes/ServerName/Apps//Drivers/#357#274#file.dmg" failed: No such file or directory (2)
any idea what i am doing wrong?
Posted on 03-13-2014 05:38 AM
rsync: link_stat "/Volumes/ServerName/Apps//Drivers/#357#274#file.dmg" failed: No such file or directory (2)
Try taking out the slash after Apps.
Posted on 03-13-2014 04:50 PM
thanks for your reply Tron, still the same error message without the extra /
any other ideas?
Posted on 03-13-2014 07:47 PM
Any particular reason you chose to use rsync for this? For a simple copy operation cp should work just fine. I'd only use rsync if I needed to make sure I wasn't recopying a large amount of data each time.
cp /Volumes/ServerName/Apps/Drivers/file.dmg /Library/Printers/PPDs/Contents/Resources/
Throw in -R after cp if you're copying a directory and not just a file.
Posted on 03-13-2014 07:55 PM
yeah good point, i tried using the cp command but it seems to be getting the same issue.
Posted on 03-13-2014 08:12 PM
Have you verified that the folders on the share do not have any spaces or special characters? With those codes in the name I'd start there. Double check the file name as well.
Posted on 03-13-2014 08:13 PM
So wait, walk me through how you're doing this? You're sending a Unix command to mount the drive in one step, then another command to do the copy? Or are you stringing the two operations together?
The error you're getting usually means one of two things:
1) The path to the file/folder to copy is wrong, or
2) The account trying to do the copy doesn't have read permissions to the directory
If using ARD for this, can you do a ls command into the directory to see if it can see the file in question? Something like:
ls /Volumes/ServerName/Apps/Drivers/
If you don't get the file.dmg or whatever it is you're looking to copy as a result, then there may be a permissions issue.
Also I see stuff in the error that may indicate some special characters in the file name, meaning the "#357#274#file.dmg" part of the error. Make sure the cp or rsync command is seeing the file name properly.
Posted on 03-13-2014 09:34 PM
Hi mm2270,
you were right, the ls command is returned with error: No such file or directory
so this is what the script looks like so far:
# Change the lines below to be the shares you want.
)
# change this for how long it waits for a drive to map.
waitfor=5
# CP /Volumes/ServerName/Apps//Drivers/Mac_Printer_Drivers?HP_LaserJet_4240.gz /Library/Printers/PPDs/Contents/Resources/
# lpadmin -p ServerName -L "printername" -E -v lpd://10.161.10.22 -P /Library/Printers/PPDs/Contents/Resources/TOSHIBA_eS4520CSeries.gz
so the idea is to map the network drive where the drivers are stored and copy to the driver folder within osx then map the printer.
Posted on 03-14-2014 06:10 AM
are you mapping the network drive first before attempting the rsync/cp? something like this maybe. If you don't map the drive first you'll never get past the directory not found error
#!/bin/sh
mkdir /Volumes/share
mount_smbfs //user:password@server/share /Volumes/share
sleep 5
cp -rv /Volumes/share/path/to/driver /Library/Printers/PPDs/Contents/Resources/
lpadmin -p ServerName -L "printername" -E -v lpd://10.161.10.22 -P /Library/Printers/PPDs/Contents/Resources/TOSHIBA_eS4520CSeries.gz
Posted on 03-20-2014 06:58 PM
Hi,
i am 1 step closer solving this issue now,
i am now able to mount the drive and perform a ls command.
i am getting an error when attempting to copy the file from the network into the library folders,
cp: /Volumes/Apps/Drivers/Mac_Printer_Drivers?HP_LaserJet_4240.gz: No such file or directory
lpadmin: Unable to open PPD file "/Library/Printers/PPDs/Contents/Resources/HP_LaserJet_4240.gz" - No such file or directory
the unix command i used is:
cp -rv /Volumes/Apps/Drivers/Mac_Printer_Drivers?HP_LaserJet_4240.gz /Library/Printers/PPDs/Contents/Resources/
lpadmin -p printer_name -L "printer_description" -E -v lpd://printer_ip_address -P /Library/Printers/PPDs/Contents/Resources/HP_LaserJet_4240.gz
Posted on 03-20-2014 08:58 PM
Is this a direct copy and paste from your script? There is a non-standard forward slash after Mac_printer_drivers
Posted on 03-20-2014 11:56 PM
great stuff spotting that, turns out my language had changed that slash, i've gone through find and replace and correct it now.
however still encountering the same error.
one thing i've noticed though is this in the error:
mkdir: /Volumes/share: File exists
mount_smbfs: mount error: /Volumes/share: File exists
cp: /Volumes/share?TOSHIBA_eS4520CSeries.gz: No such file or directory
lpadmin: Unable to open PPD file "/Library/Printers/PPDs/Contents/Resources/TOSHIBA_eS4520CSeries.gz" - No such file or directory
if i add a ls command and blank out the other parts in that script i can see the list of files file. however if i type the ls command into terminal i get a permissions denied error.
so is the drive mapped properly or not?
Posted on 03-21-2014 06:21 AM
you've got another non-standard forward slash before Toshiba_eS4520CSeries.gz.
You're going to want to check all of your syntax to make sure you're not running into non-standard characters like that. Copy/pasting from the web has always proven to be a problem in formatting a script.
Posted on 03-23-2014 11:07 PM
all sweet now after fixing all the non standarded slashes.
thanks for all your help guys! i was pulling my hair out.