|
|
#1 |
|
Prospect
Join Date: Jun 2004
Posts: 25
|
Example of how to upload a file using shell?
Is using "do shell script" and cURL really a better way to upload a file than URL Access Scripting? If so, can somebody give me a simple example of how to upload a small text file with this method?
__________________
15" PowerBook (Aluminum) 1 GHz PowerPC G4 256 MB DDR SDRAM 60 GB Ultra ATA/100 Airport Extreme Card Mac OS X v10.3 Panther 15" iMac (Graphite) 600 MHz PowerPC G3 512 MB SDRAM 120 GB Western Digital Caviar Mac OS X v10.3 Panther |
|
|
|
|
|
#2 |
|
Triple-A Player
Join Date: Aug 2004
Location: Toronto
Posts: 76
|
Not sure about cURL, but for stuff like this, I usually end up using ncftp.
|
|
|
|
|
|
#3 |
|
Triple-A Player
Join Date: Nov 2002
Location: Massachusetts
Posts: 202
|
scp?
Probably not the best suggestion for this if you're batch moving a bunch of files, but when I want to move one or two files quickly between machines via the internet, I use the secure scp command:
scp filename username@target_domain.com:filename You'll be prompted for your username and password for your target. If you need to copy a whole bunch of files, put them in the same directory, and then copy the directory with the -r flag set. (man scp, to learn more) Hope that helps some.
__________________
There is no such thing as a stupid question. If you don't ask, you will never know. |
|
|
|
|
|
#4 |
|
All Star
Join Date: Apr 2003
Location: OH
Posts: 934
|
interesting .. i didn't know about the -r flag for scp. i've been using rsync.
on that note, anyone know what's quickest? 'rsync' or 'scp -r' for copying an extremely large directory (1-10GB+)? perhaps i'll do a test tomorrow if time allows
|
|
|
|
|
|
#5 |
|
Major Leaguer
Join Date: Dec 2002
Posts: 291
|
If it is a one time transfer with no exclusions, then I would say they are about the same. However, if you will be doing updates or want to exclude parts of the subdirectory, rsync is your friend.
|
|
|
|
|
|
#6 |
|
Triple-A Player
Join Date: Nov 2002
Location: Massachusetts
Posts: 202
|
One caveat to be aware of:
cp -- and I think it safe to assume scp, too -- will strip the resource forks from Mac files. Being a core UNIX command, cp simply doesn't know how to handle resource forks. So any custom icons or data in resource forks will be lost. I learned this as a trick to strip the resource-fork from jpegs before sending them to friends with Windows-based computers (no longer needed due to improvements in Mail.app).
But if you use Stuffit to put your files in .sit or .sitx archives, and then copy the SIT/SITX file, you can safely move your files without losing the resource forks. Just something to be aware of if the resource forks are important to you.
__________________
There is no such thing as a stupid question. If you don't ask, you will never know. |
|
|
|
|
|
#7 | |||||||||||||||||||||||
|
Major Leaguer
Join Date: Dec 2002
Posts: 291
|
This goes for rsync as well. However, there are HFS friendly versions of both rsync and cp. (rsyncX an CpMac) |
|||||||||||||||||||||||
|
|
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|