LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-28-2003, 04:01 PM   #1
atlight
LQ Newbie
 
Registered: Oct 2003
Posts: 2

Rep: Reputation: 0
Linux Scripting


Sorry but I am new to linux and I hope someone can help me. I am running an ftp server on redhat(7.3). What I need to do is create some sort of script that will look every so often (every hour would do) then email me when that file is there so that I can pull that file down do what I need to with it.

Is this possible or am I nuts?
 
Old 10-28-2003, 04:04 PM   #2
trickykid
LQ Guru
 
Registered: Jan 2001
Posts: 24,149

Rep: Reputation: 269Reputation: 269Reputation: 269
Sure its possible.. create a script that searches or finds a file in the location, if its there it will mail you and you can setup a script like this to using cron.

Good place to start learning any shell scripting or bash scripting would be the Advanced BASH Scripting howto here: http://www.tldp.org/LDP/abs/html/
 
Old 10-28-2003, 04:10 PM   #3
david_ross
Moderator
 
Registered: Mar 2003
Location: Scotland
Distribution: Slackware, RedHat, Debian
Posts: 12,047

Rep: Reputation: 79
Welcome to LQ.

A script like this should do:
Code:
#!/bin/bash

if [ -f /path/to/file ]; then
echo Your file is there | mail atlight -s "Your file exists"
fi
Make your script executeable:
chmod 700 /path/to/script

Then just add a cron entry to run it every so often eg an hour:
0 * * * * /path/to/script
 
Old 10-29-2003, 08:11 AM   #4
atlight
LQ Newbie
 
Registered: Oct 2003
Posts: 2

Original Poster
Rep: Reputation: 0
Great I will try these suggestions.Thank you all for your replies. This forum is awesome.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
linux scripting desheikh Linux - General 2 10-05-2005 05:45 AM
linux scripting help anirudh Programming 6 03-04-2005 10:33 PM
Scripting in Linux Rv5 Programming 2 09-05-2004 10:14 PM
Linux scripting Cybercool Linux - Newbie 5 04-16-2004 01:57 AM
Linux Scripting SainT1337 Linux - General 3 11-30-2003 01:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 02:54 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration