Koozali.org: home of the SME Server

Create new CRON job

Henrik

Create new CRON job
« 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?

Curly

Re: Create new CRON job
« Reply #1 on: August 02, 2003, 01:21:56 AM »
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)