FTP shell script
I need to mput a few hundred files from on of my servers to another, and I dont have the desire to sit there till it is done.I have a very basic knowledge of C php and perl and with that I was able to figure out a shell script that *almost* works for me. It works with the put command, but I cand figure out how to get it to work with the mput command
Code:
#!/bin/sh HOST='ftp.host.net' USER='yourid' PASSWD='yourpw' FILE='file.txt' ftp -n $HOST <<END_SCRIPT quote USER $USER quote PASS $PASSWD put $FILE quit END_SCRIPT exit 0
BTW: while I'm asking this I'll ask another similar question too:
The scenario: I have several images that I need to create thumbs for. I have downloaded and compiled the latest version of NetPBM. This will do the job for me.
The problem: If I have 200 images i need thumbs for, I dont want to have to sit here typing in the command for each and every one.
Here's the basics
Assume the image is called "test.jpg", size of it is 1024x768. I
want
a thumnail of 100x100 at max, but leave the aspect ratio.
# jpegtopnm test.jpg > test.pnm
This extract the JPEG to the (non-lossy) PNM format
# pnmscale -xysize 100 100 test.pnm > test_thumb.pnm
-xysize specifies a bounding box. pnmscale scales the input image to
the
largest size that fits within the box, while preserving its aspect
ratio.
# pnmtojpeg --quality 75 test_thumb.pnm > test_thumb.jpg
Converts the pnm to a jpeg, using the jpeg lossy quality of 75%.
want
a thumnail of 100x100 at max, but leave the aspect ratio.
# jpegtopnm test.jpg > test.pnm
This extract the JPEG to the (non-lossy) PNM format
# pnmscale -xysize 100 100 test.pnm > test_thumb.pnm
-xysize specifies a bounding box. pnmscale scales the input image to
the
largest size that fits within the box, while preserving its aspect
ratio.
# pnmtojpeg --quality 75 test_thumb.pnm > test_thumb.jpg
Converts the pnm to a jpeg, using the jpeg lossy quality of 75%.
Thanks again
