I need to determine if any three files have the same file size in a specified directly?
I have got as far as listing the file sizes but where to go from here?
ls -al |sort -n -r +4 | awq '{print $5}'
Thanks in anticipation (5 Replies)
I need to zip all the files within a directory on a daily basis and store them as a zip file within that directory with the date in its naming convention
I have file extentions .log .lst and .out's within that directory
How do i do this task
zip -mqj mydir/allzip$YYMMDDDD.zip mydir/*.*
... (5 Replies)
We recieve some logs on our windows box via FTP on a daily basis, in the same directory. I would like to check for missing logs files and add their name to a text file.
Something like...
Check if C:\logs\file1_currentdate exists (if not, add file1_currentdate to... (1 Reply)
Need help on this script.
the month is not changing to February...
#!/bin/bash
for X in `seq 1 100`
do
DATE=`date +%Y-%m-%d "--date=${X} day ago"`
Y=`date +%Y`
M=`date +%m`
D=`date +%d "--date=${X} day ago"`
DIR=/home/LogBackup
for i in `seq 1 `
do
if ;then
# ... (1 Reply)
Hi
I am still learning how to write shell scripts, so I started to write a script like this:
#!/bin/sh
date
echo
outputOK () {
echo $1 ""
}
outputOK () {
echo $1 ""
}
for vol in `/usr/bin/grep -E 'hfs|vxfs|nfs|cifs' /etc/fstab | egrep -v '^#' | awk '{ print $3 }'`
do
if... (7 Replies)
hi,
I am having script in which i want to check if directory has any file in it or not. If directory contains a single or more files then and only then it should proceed to further operations...
P.S.: Directory might have thousand number of files. so there might be chance of getting error... (4 Replies)
I'm working on a bash script to move files from one location, to two. The first part of my challenge is intended to check a particular directory for contents (e.g. files or other items in it), if files exists, then send the list of names to a txt file and email me the text file. If files do not... (4 Replies)
Is there a way to calculate the total file size of HDFS file directory in GB or MB? I dont want to use du/df command. Without that is there a way
HDFS
Directory - /test/my_dir (1 Reply)
I'm trying to wirte ksh script for given requirement, but i unable to achive it.
In dir1 directory I need to check for the files which suffixed with .csv or .txt, If there is no files, then i need to exit. If any files found I need to move the each file found to dir2 directory. I have to repeat... (4 Replies)
Discussion started by: Kayal
4 Replies
LEARN ABOUT CENTOS
crontabs
CRONTABS(4) Crontabs users' Manual CRONTABS(4)NAME
crontabs - configuration and scripts for running periodical jobs
SYNOPSIS
run-parts [--list|--test]<directory>
DESCRIPTION
Crontabs is a historical name for the run-parts script and the system crontab. The run-parts script runs all executables in the specified
directory. Run-parts runs all executables in the specified directory. The execution of files can be allowed or denied by creating file
jobs.allow or jobs.deny which worked similar as other allow/deny config files. The file must be created in the specified directory.
--list print names of all files (not limited to executables), but don't run them. This option can't be used with test option.
--test print names of files, which would be run.
Randomization of jobs can be configured in the /etc/sysconfig/run-parts file. To enable randomization of jobs, set the RANDOMIZE
parameter to 1 and set the RANDOM parameter to an integer which determines a random seed. Additionally, you may configure the RAN-
DOMTIME parameter (again, by specifying an integer) to provide an additional level of randomization. Jobs are not randomized when
the RANDOM and RANDOMTIME parameters are set to 0. Values in these two parameters must be set to 1 or larger to provide a good
enough randomization.
Randomization of cron jobs can be useful for shared networks, where multiple cron jobs executed at once can cause spikes in traffic,
especially during daily jobs. With randomized jobs, the workload is evenly distributed throughout the day.
EXAMPLE OF CONFIGURATION FILE
RANDOMIZE=1
RANDOM=4
RANDOMTIME=8
Historically the crontab file contained configuration which called run-parts on files in cron.{daily,weekly,monthly} directories. These
jobs are now run indirectly through anacron to prevent conflicts between cron and anacron. That means the anacron package has to be
installed if the jobs in these directories should be running. Refer to the anacron(8) how to limit the time of day of the job execution.
EXAMPLE
/etc/cron.daily/jobs.deny could contain for example 0logwatch which forbid execution of this script.
SEE ALSO anacron(8), crontab(5)Marcela Malaova 2012-08-29 CRONTABS(4)