[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 895
  • Last Modified:

crontab ftp

I'm looking for some assistance in setting up a crontab process to ftp 7 text files from a linux server to a windows 2k server. I've done very little work with linux on the command line. I know enough to get me around, but not enough to develop something. If someone has a suggestion on a resource to assist me or can write me an example script, that would be great.

- Ian
0
black0ps
Asked:
black0ps
  • 2
  • 2
1 Solution
 
TintinCommented:
To create a FTP script, use something like:

#!/bin/sh

ftp -inv <<EOF
open hostname
user username password
cd somedir
prompt
mput *.txt
quit
EOF

How often do you want it to run?  There's a few different ways to setup cronjobs.  
0
 
black0psAuthor Commented:
I need to run it once a day.
0
 
wesly_chenCommented:
The name of Tintin's script is /usr/local/bin/ftp.sh
Then
# crontab -e
1 * * * * /usr/local/bin/ftp.sh > /dev/null 2>&1

Wesly
0
 
wesly_chenCommented:
Sorry. it should be
0 1 * * * /usr/local/bin/ftp.sh > /dev/null 2>&1     <=== Every day at 1:00AM

Wesly
0
 
TintinCommented:
Alternatively, you can place your script in /etc/cron.daily (assuming you have vixie-cron installed)
0

Featured Post

NEW Veeam Agent for Microsoft Windows

Backup and recover physical and cloud-based servers and workstations, as well as endpoint devices that belong to remote users. Avoid downtime and data loss quickly and easily for Windows-based physical or public cloud-based workloads!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now