I'm not a UNIX guy, but I need to tell UNIX to search for all files in recursive subdirectories that are named YYMMDD.Z where YYMMDD is yesterday's date.
So far, I've computed yesterday's date with this:
Now for the rest of it. I think in DOS I'd simply say
I need to use AWK to convert that ls output into an FTP script such as
then I finally need to execute that dynamic FTP script.
Is this too much to ask on the forum? If not, thanks for thinking it through. If so, please let me know.
Thanks,
Take care,
--Shaun Merrill
Seattle, WA
So far, I've computed yesterday's date with this:
Code:
# Yesterday.AWK
BEGIN {
printf "Yesterday's filename is '%s.Z'\n",strftime("%y%m%d",systime()-86400)
}
Now for the rest of it. I think in DOS I'd simply say
Code:
DIR /S /B YYMMDD.Z and it would list out the files that matched.
Once I get the names of the files (if any), I need to FTP them into the ftp://hostname/ACD/Loc99/YYMMDD.Z location, where "/loc99/" is the same part of the filename from the above directory listing. (The same directory already exists on the destination side.)
So I need to know how to convert this DOS idea into a pure UNIX idea, like this:
Compute yesterday's filename (with the above AWK scriptlet)
build an "ls" command (I think that's the equivalent of DIR) that looks for file names in the UNIX system
I want the output of the ls command to resemble this:
[code]
/u/data/reports/loc13/030917.z
/u/data/reports/loc5/030917.z
/u/data/reports/loc19/030917.z
Code:
user username
passwierd
cd ../../../u/data/reports/
binary
put loc13/030917.Z
put loc5/030917.Z
put loc19/030917.Z
disconnect
quit
then I finally need to execute that dynamic FTP script.
Is this too much to ask on the forum? If not, thanks for thinking it through. If so, please let me know.
Thanks,
Take care,
--Shaun Merrill
Seattle, WA