Koozali.org: home of the SME Server
Legacy Forums => General Discussion (Legacy) => Topic started by: Henrik on July 31, 2003, 12:42:46 AM
-
Hellu
I need some help getting started on this.
What i need to accomplish:
1. Download a file via FTP to a specific folder
2. Run a perl script after the file is downloaded
3. Copy all files and folders from a folder to another folder on same hd
This job should run once in an hour.
Any idea?
-
Hmm, you're not getting any help....
Make a script that runs the commands that you want, and execute the scripts by cron.
script like (sort of):
cd /specific/folder
# Now ftp
HOST='ftp.users.qwest.net'
USER='yourid'
PASSWD='yourpw'
FILE='file.txt'
ftp $HOST <user $USER
$PASSWD
put $FILE
quit
# now run perl
/home/e-smith/files/users/yourname/home/perl_script
# copy
cp *.txt /home/e-smith/files/users/notyourname/home/folder
=========== end script ============
Make sure your script is executable (chmod 755 script_name), and test it first
Then execute the script via cron (see man cron for details)