04-15-2009
Yes as you said you can do with a slight modification in that.
Invoke a find command in crontab for a specified interval, and invoke the script from there if only the directory content has got changed.
Give the path as that directory only, so CPU resources wont get wasted.
This is one way, other ways are also welcome.
Have you got it ?
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi all,
I've included some variables in my .bashrc file. But everytime i'm logging in i need to source my .bashrc file to make effect of my variables.
i'm having an account on a highly secured production environment.
I've the following in my ~/.bashrc file
alias cls=clear
How to make... (2 Replies)
Discussion started by: kalyanraj
2 Replies
2. UNIX for Dummies Questions & Answers
how would i go about creatng a backup of a file everytime a script is run so that the next time it is run the old backup gets pushed back and the most recent backup is 1st.
(new)backup.1
(old)backup.2
that kind of idea?? (4 Replies)
Discussion started by: knc9233
4 Replies
3. Shell Programming and Scripting
One of our servers runs Solaris 8 and does not have "ls -lh" as a valid command. I wrote the following script to make the ls output easier to read and emulate "ls -lh" functionality. The script works, but it is slow when executed on a directory that contains a large number of files. Can anyone make... (10 Replies)
Discussion started by: shew01
10 Replies
4. UNIX for Dummies Questions & Answers
Hey,
I have finally made a command that works and now has to run it on 200+ files to run it on.
How do I do that?
Just fyi and if it complicates anything my commandline is:
awk '{if ($1 ~ /1/) print $2}' file
(yup, is should print $2 if $1 is a certain value)
It doesn't work when I: ... (2 Replies)
Discussion started by: lost
2 Replies
5. Shell Programming and Scripting
Good morning. I am searching for "how-to"'s for some particular questions:
1. How to write a script in HP-UX 11.
2. How to schedule a script.
3. How to "call" scripts from the original script.
4. How to su to another user from within a script.
This is the basics of what the... (15 Replies)
Discussion started by: instant000
15 Replies
6. UNIX for Dummies Questions & Answers
The way this works from the command prompt is:
___________________________________________
cd /data/local/bin
chmod 0755 file.bin
./file.bin
_______________________________________________
How do I make this happen in a script. The file must be run in its directory but I can not get the... (2 Replies)
Discussion started by: chrstdvd
2 Replies
7. UNIX for Dummies Questions & Answers
I created a script called title
#!/bin/sh
echo "^0;$*^G"
It will change the terminal window titlebar to what ever I type after the script (title BIG would change titlebar to BIG instead of terminal) Is there a way to make it run so it will work on every terminal window that gets opened.... (1 Reply)
Discussion started by: amason0508
1 Replies
8. Shell Programming and Scripting
Hi,shell script is scheduled from maestro and we want mastero should not run shell script so can we edit the shell script so that it should run.ThanksPrakash (5 Replies)
Discussion started by: prakashdba2010
5 Replies
9. Shell Programming and Scripting
Hello,
Is there any method thorugh which script can take argument if pass otherwise if argument doesn't pass then it takes the argument from the configuration file
i.e I am workiing on a script which will run through crontab and the script will
chekout the code ,zip and copy to the... (3 Replies)
Discussion started by: rohit22hamirpur
3 Replies
10. Shell Programming and Scripting
I have this little bash script I use to transcode mkv files using handbrake.
#!/bin/bash
sourcedir="/media/raid10/video/to_be_encoded_series"
destdir="/media/raid10/video/series"
cd "$sourcedir"
for i in *.mkv; do
HandBrakeCLI -i "$i" -o "$destdir/${i%.*}.mkv" -e x264 -q 20.0 -E copy -B... (4 Replies)
Discussion started by: barrydocks
4 Replies
LEARN ABOUT REDHAT
archive
ARCHIVE(8) System Manager's Manual ARCHIVE(8)
NAME
archive - Usenet article archiver
SYNOPSIS
archive [ -a archive ] [ -c ] [ -f ] [ -i index ] [ -p newsgroups list ] [ -r ] [ input ]
DESCRIPTION
Archive makes copies of files specified on its standard input. It is normally run either as a channel feed under innd(8), or by a script
before expire(8) is run.
Archive reads the named input file, or standard input if no file is given. The input is taken as a set of lines. Blank lines and lines
starting with a number sign (``#'') are ignored. All other lines should specify the token of an article to archive. Every article is
retrieved from a token and the Xref: header is used to determine the target file in the archive directory. You can limit the targets taken
from the Xref: header with the ``-p'' option.
Files are copied to a directory within the archive directory, <patharchive in inn.conf>. The default is to create a hierarchy that mimics
the input files; intermediate directories will be created as needed. For example, if the input token represents article 2211 in the news-
group comp.sources.unix, it will be copied to <patharchive in inn.conf>/comp/sources/unix/2211.)
OPTIONS
-a archive
If the ``-a'' flag is used then its argument specifies the directory to archive in instead of the default.
-c If the ``-c'' flag is used, then all directory names will be flattened out, replacing the slashes with periods; and all posts will
be concatenated into a single file with the final component name being YYYYMM which means the local execution time of archive(8).
In this case, on December 14, 1998, the file would be copied to <patharchive in inn.conf>/comp.sources.unix/199812. Note: The
``-c'' flag implies the ``-f'' flag.
-f If the ``-f'' flag is used, then all directory names will be flattened out, replacing the slashes with periods. In this case, the
file would be copied to <patharchive in inn.conf>/comp.sources.unix/2211.
-i If the ``-i'' flag is used, then archive will append one line to the specified index file for each article that it copies. This
line will contain the destination name and the Message-ID and Subject headers.
-p Limits the targets taken from the Xref: header to the groups specified in the newsgroups list. The newsgroups list is a comma sepa-
rated wildmat(3) list of newsgroups you wish to have archive handle.
-r By default, archive sets its standard error to <pathlog in inn.conf>/errlog. To suppress this redirection, use the ``-r'' flag.
EXIT STATUS
If the input is exhausted, archive will exit with a zero status. If an I/O error occures, it will try to spool its input, copying it to a
file. If there was no input filename, the standard input will be copied to <pathoutgoing in inn.conf>/archive and the program will exit.
If an input filename was given, a temporary file named input.bch (if input is an absolute pathname) or <pathoutgoing in inn.conf>/input.bch
(if the filename does not begin with a slash) is created. Once the input is copied, archive will try to rename this temporary file to be
the name of the input file, and then exit.
EXAMPLES
A typical newsfeeds(5) entry to archive most source newsgroups is as follows:
source-archive
:!*,*sources*,!*wanted*,!*.d
:Tc,Wn
:<PREFIX specified with --prefix at configure>/archive -f -i
<patharchive in inn.conf>/INDEX
HISTORY
Written by Rich $alz <rsalz@uunet.uu.net> for InterNetNews. This is revision 1.7.2.1, dated 2000/08/17.
SEE ALSO
inn.conf(5), newsfeeds(5).
ARCHIVE(8)