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?
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.
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:
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.
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.
# 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.
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
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
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?
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.