Sponsored Content
Full Discussion: Script advice
Top Forums Shell Programming and Scripting Script advice Post 302704367 by davidra on Friday 21st of September 2012 12:52:19 PM
Old 09-21-2012
Script advice

All

I have 2 parent directories - input and output. Each parent has multiple sub-directories...each sub-directory has multiple files. Each parent directory structure is a mirror image of itself

I need to poll the imput directory and if a new file is found, encrypt the file, move the file to its mirror image (output directory) and then delete itself from the input directory

I apprciate I can use cron to poll the directories and use find to list the files but what would be an elagant solution to this request.

This is what I think I can do so-far .....

<at parent directory>find . -type f -mtime -l -exec <encript file> | -exec mv
... but how do I mv the file to its mirror image directory location ?


Any advise / solution would be great

Thanks in advance
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

c-shell script advice please.

Hi, I have the following script running in my cron. -------------------------------------------------------------------- #!/bin/csh bnstat -p GPD_VSLinux | grep pg | grep varcon | awk '{print $1, $2, $3, $4, $5, $6, $7, $8, $9, $10}' > /tmp/LX_xbatch.log bnstat -p GPD_VSLinux_test | grep pg... (2 Replies)
Discussion started by: killerserv
2 Replies

2. Shell Programming and Scripting

first script. need help and advice.

Hello everyone, This is my first post here and this is the first time I am using UNIX OS (Slackware). I find it really useful and powerful and would like to master it but as you may guess I am expreicing quite a few problems. I've been reading a few documentations about it and bash this week... (17 Replies)
Discussion started by: sanchopansa
17 Replies

3. Shell Programming and Scripting

Advice on Script

I would like some advice on how to logically put together a script to handle a daily task of data gathering for the following problem. I have two files, file1 has 125,000 records that I cut and remove unwanted fields through scripts and cron. In file2, I have 25000 records that has the same... (4 Replies)
Discussion started by: greengrass
4 Replies

4. Shell Programming and Scripting

Script Advice please?

Ok. I want to parse a log file and search only for denied traffic for the previous hour. The log looks like this: Jun 18 17:47:56 routername 36806: Jun 18 17:53:01.088: %SEC-6-IPACCESSLOG: list ingress-filter denied tcp 1.2.3.4(1234) -> 6.7.8.9(53), 4 packets I only really care about the... (12 Replies)
Discussion started by: earnstaf
12 Replies

5. Shell Programming and Scripting

Script Help/Advice

Alright, I feel like I have a pretty good basic knowledge of shell scripting, but this one is throwing me for a loop. I know I've seen something similar done with awk, but I couldn't find it with the search function. I've grepped through my log file and get results like this: --... (14 Replies)
Discussion started by: earnstaf
14 Replies

6. Shell Programming and Scripting

advice on shell script

Hello, I have this script running on cron every 20 minutes. By 12pm daily, our system is expecting all input files to be uploaded by the script. After this cutoff time, the script would still be running though, but i need some kind of alerts/logs to know which input files weren't received for... (1 Reply)
Discussion started by: gholdbhurg
1 Replies

7. Shell Programming and Scripting

Looking for optimization advice on a short script

I already have a solution to my problem, but I'm looking to see if it can be made more succinct and faster. The problem: given a list, as shown below, extract the pathname for any file in a directory named 'ample' and return it's index into the list. The index is also in the data itself. Note that... (1 Reply)
Discussion started by: prigo
1 Replies

8. Shell Programming and Scripting

Advice on script

Hi folks, I use following script:- #!/bin/sh # cd Linbread TODAY=`date +"%m%d"` DATA=`grep $TODAY linbread.dat` HOUR=`date +"%H"` if then TOD="Morning" elif then TOD="Afternoon" else TOD="Evening" fi echo $DATA | gawk -F"|" '{printf("%s\n\n%s",$2,$3)}' > $$tmp fold -s -w60... (0 Replies)
Discussion started by: satimis
0 Replies

9. Shell Programming and Scripting

Need advice on approach for script

Greetings all. I have a repository server which receives, without exhaggeration, several million files a week. The majority of these files are in .csv format, which means they're highly compressable. They are spread throughout numerous directories where there are configured monitoring utilities... (4 Replies)
Discussion started by: msarro
4 Replies

10. UNIX for Advanced & Expert Users

Advice on a backup script, maybe one is out there already?

Hi, Not sure whether this is the right place to post it. I decided to post it here 'coz Advanced and Expert users will most likely have the answer to what I am looking for. I want to backup scripts that I have access to to a tar file file and zip it. At the moment I am creating a directory... (4 Replies)
Discussion started by: newbie_01
4 Replies
MM(1L)																	    MM(1L)

NAME
mm - mirror master SYNOPSIS
mm [flags] [package-files] DESCRIPTION
mm is the mirror master. It runs multiple calls to mirror in parallel and handles locking and minimal retry times. As with mirror, mm is a package written in Perl. mm presumes that all the package details are stored in a directory called packages. All the packages for a given site must be in a file whose name is the same as that of the site. So in packages/sunsite.org.uk will be all the package details for the host sunsite.org.uk. OPTIONS
-t Ignore the minimal retry timers. -o site:package Only mirror the given site:package. -debug Enable debugging. If this argument is given more than once the debugging level will increase. Currently the maximum useful level is four. -s Enable status debugging. This will print out the status of any subprocess as it is spawned or as it exits. CONFIGURATION FILE The configuration file is parsed as a series of statements. Blank lines and lines beginning with a hash are ignored. There are are two kinds of statements, controls and site:package details. Control statements are of the form: keyword=value You can add whitespace around the equals. Here is a list of the keywords and their values, any defaults are given inside square brackets: home Directory that mm chdirs to before doing any work. [''] max Maximum number of mirrors that can be running in parallel at any one time ['6'] mirror This is the way to call mirror. Any occurence of $args, $package or $site is replace with the appropriate entry from the package. Any $pkg is replaced with a version of $package with all characters that cause problems in filenames converted to underscore. The default is: exec ./mirror $args -p'$package' packages/$site > logs/$site:$pkg 2>&1 [''] cmd Run the given command. This can occur multiple times. [''] cmdin Run the given command and use its output as mm input. This can occur multiple times. [''] skip Skip the given site:package when it occurs. [''] In addition to control statements there are also package details. Each package details statement is of the form: site:package min-restart-last-ok min-restart-last-notok mirror-args The site and package fields are matched against those in the packages. A mirror will only be run to this site:package if the last mirror run was more than min hours out. The min-restart-last-ok limit will be used if the last call to mirror was successful. If the mirror call failed then min-restart-last-notok will be used. EXAMPLES
Here is a simple mm input file to manage mirroring two packages. home=/public/mirror ftp.cl.cam.ac.uk:JIPS-nrs 20 20 hcrl.open.ac.uk:hcrl-psion 20 20 More usually the auxilly program pkgs_to_mmin will be used to automatically convert the contents of the packages directory into the site:package statements. home=/public/mirror cmdin=./pkgs_to_mmin packages/* AUTHOR
Written by Lee McLoughlin <lmjm@icparc.ic.ac.uk>. 21 April 1993 MM(1L)
All times are GMT -4. The time now is 06:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy