Skip to main content
Question

copying files from network onto computer


Forum|alt.badge.img+3

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

Forum|alt.badge.img+9
  • Contributor
  • 94 replies
  • March 13, 2014

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.


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 6 replies
  • March 13, 2014

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

any other ideas?


mm2270
Forum|alt.badge.img+16
  • Legendary Contributor
  • 7880 replies
  • March 14, 2014

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.


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 6 replies
  • March 14, 2014

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


stevewood
Forum|alt.badge.img+35
  • Employee
  • 1797 replies
  • March 14, 2014

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
Forum|alt.badge.img+16
  • Legendary Contributor
  • 7880 replies
  • March 14, 2014

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.


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 6 replies
  • March 14, 2014

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.


Forum|alt.badge.img+12
  • Contributor
  • 417 replies
  • March 14, 2014

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

Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 6 replies
  • March 21, 2014

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


Forum|alt.badge.img+16
  • Honored Contributor
  • 403 replies
  • March 21, 2014

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


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 6 replies
  • March 21, 2014

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?


Forum|alt.badge.img+12
  • Contributor
  • 417 replies
  • March 21, 2014

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.


Forum|alt.badge.img+3
  • Author
  • New Contributor
  • 6 replies
  • March 24, 2014

all sweet now after fixing all the non standarded slashes.

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


Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings