copying files from network onto computer

dogfight
New Contributor

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?

13 REPLIES 13

tron_jones
Release Candidate Programs Tester

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.

dogfight
New Contributor

thanks for your reply Tron, still the same error message without the extra /

any other ideas?

mm2270
Legendary Contributor III

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.

dogfight
New Contributor

yeah good point, i tried using the cp command but it seems to be getting the same issue.

stevewood
Honored Contributor II
Honored Contributor II

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.

mm2270
Legendary Contributor III

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.

dogfight
New Contributor

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.

acdesigntech
Contributor II

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

dogfight
New Contributor

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

chriscollins
Valued Contributor

Is this a direct copy and paste from your script? There is a non-standard forward slash after Mac_printer_drivers

dogfight
New Contributor

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?

acdesigntech
Contributor II

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.

dogfight
New Contributor

all sweet now after fixing all the non standarded slashes.

thanks for all your help guys! i was pulling my hair out.