Put this together from somewhere else on the forums, just modified it and added the loop.
This script gets called by another script through a cron job every 5 minutes:
Anyways, I was wondering if there was any way of making it a little better. Currently this simply ftp's that static file every 5 minutes, regardless of if the file has been updated or not. The way it works now is if someone needs to make an update to the 4 server's that this script FTP's to, they simply drop their archive file(named archive.tar) to the /tmp/abcQATest/ directory, and then within 5 minutes the crontab runs and ftp's their file to server 1-4 at the /tmp/archive.tar location.
Is there any way to set this up so it only ftp's the file if it's been updated since the last time the ftp ran? That way, if it gets updated, it get's FTP'd once, but then it doesn't get FTP'd again unless the file's been changed?
Then on the other 4 servers, I also need something like this:
The do something part is just a couple quick moves, extracts and deletes, that's no big deal. It's If statement I am stumped on.
I believe you have to use the -a parameter on the diff command to compare binaries.
It worked, but now even if archive.tar and backup.tar are the same, it says their different and it runs the first block, instead of just doing the echo which states "Files the same, exiting";
hi can any one please help on below .im new to shell scrpting
i need to write a shell script which will check particular log file is presented or not in specific location ,if yes how long it was not modified/not rolling ?if its not modified/log is not rolling script will have to send mail (9 Replies)
Input File1 constatntly running and growing in size.
My Program Erorr ddmmyy hh:mm:ss My Program Error
**Port 123 terminated
**ID PIN 12345
Comamnd Successful
Command Terminated
Command Successful
Command Terminated
**My Program Erorr ddmmyy hh:mm:ss My Program Error
**Port 345... (3 Replies)
Hi,
I am looking for a command to search for a specific file which was recently modified in the current directory leaving some unwanted files to be listed.
For example, when I try ls - lrt
it shows the following output.
I want to ommit the files with the name 'resend' and... (3 Replies)
Hi,
I have a file, fileA, that consists of two fields. Field 1 has an old object name, and field 2 has a new object name. I would like to search and replace a master file, FileB, by substituting the old object name (field 1 in fileA) with the new object name ( field 2 in fileA).
FileA:... (16 Replies)
hi all, i'm a student and managing lab at my insti. there in one application in which log file has to be maintaine the number of bytes transferred and received. but after certain entries these two attributes stop getting updated and holds same values for rest of the session. This happens one time... (4 Replies)
Hi all,
my problem is teh following:
I need to move a file from a folder to another and I usually do it by the get command but in this case I have a list of file in the source folder and I have to select only the lust updated one.
Ho to do this?
All the files have the same name followed... (4 Replies)
hi,
i was wondering if there is a way to find out which file is updated the most recent time in the entire file system.... most probably this would be refering to some LOG file, but i wanna find a way which file was that...
some script should work or what?
can anybody help me out on that.
for... (3 Replies)
Hi,
I would like to define a script in order to update a file with the last updated records:
I wrote :
#!/bin/sh
YEAR=$(date +%Y)
MONTH=$(date +%m)
DAY=$(date +%d)
COMM=/usr/bin/comm
for file in * ;
do
if ] ; then
FILE=${DPSTY}
UNIQUE=Unique_${FILE}
... (4 Replies)