I am creating a KSH script and need to check the filedate against the system date. I can get the sys date w. date command, and I was able to get the filedate w. the awk command but when I compare them w. an if condition statement I get syntax error.
Not sure what's wrong, and other suggestions on... (4 Replies)
Hi Guys.
I am very new to UNIX.
I need to get yesterdays and tommorows date given todays date.
Which command and syntax do i use in basic UNIX shell.
Thanks. (2 Replies)
Daily one file will dropped into this directory.
Directory: /opt/app/jt/drop
File name: XXXX_<timestamp>.dat.gz
I need to write a script which checks whether the file is dropped daily or not.
Any idea in the script how can we compare timestamp of the file to today's date?? (3 Replies)
Hi
I am very new to shell scripting and have written a script (below).
However the directory I am searching will contain a file with a .trn extension each day which I want to eliminate.
Each day the file extension overnight will change to trx, if this fails I want to know.
Basically what I... (2 Replies)
Hi guys, i am new to perl. I started reading the perl documents and try to come up with some logic.
I am trying to create a script that would go into a location, search for todays files, then searches for all .txt files from today.
If todays not found, its an error
If file size is less... (26 Replies)
Hi Folks,
I have created a script last month to retrive files thru FTP and cronjob was running fine till yesterday. But the naming convention of the daily file is Filename_<date>.xml
where date is YYYYMMDD. But today i have received file name as Filename_20110232.xml :(
Part of my Perl... (4 Replies)
Hi all,I need your help to create the script.I need a script to check the ZIP file at network location with yesterday date name. ZIP file creation date is current date, but name of the zip file is previous date. for example file name "20110216.zip" created today 201102017.I just want to return the... (1 Reply)
Hi,
I want to compare today's date(DDMMYYYY) with yesterday(DDMMYYYY) from system date,if (today month = yesterday month) then execute alter query else do nothing.
The above requirement i want in Shell script(KSH)...
Can any one please help me?
Double post, continued here. (0 Replies)
hi all,
How to compare two files whether they are same are not...? like i had my input files as 20141201_file.txt and 20141130_file2.txt
how to compare the above files based on date .. like todays file and yesterdays file...? (4 Replies)
Hi All,
I am new in scripting and working in a project where we have RSyslog servers over CentOS v7 and more than 200 network devices are sending logs to each RSyslog servers. For each network devices individual folders create on the name of the each network devices IP addresses.The main... (7 Replies)
Discussion started by: Pinaki
7 Replies
LEARN ABOUT CENTOS
fixfiles
fixfiles(8)fixfiles(8)NAME
fixfiles - fix file SELinux security contexts.
SYNOPSIS
fixfiles [-v] [-F] [-B] [ -N time ] [-l logfile ] { check | restore|[-f] relabel | verify } [[dir/file] ... ]
fixfiles [-v] [-F] [ -R rpmpackagename[,rpmpackagename...] ] [-l logfile ] { check | restore | verify }
fixfiles [-v] [-F] -C PREVIOUS_FILECONTEXT [-l logfile ] { check | restore | verify }
fixfiles [-F] [-B] onboot
DESCRIPTION
This manual page describes the fixfiles script.
This script is primarily used to correct the security context database (extended attributes) on filesystems.
It can also be run at any time to relabel when adding support for new policy, or just check whether the file contexts are all as you
expect. By default it will relabel all mounted ext2, ext3, xfs and jfs file systems as long as they do not have a security context mount
option. You can use the -R flag to use rpmpackages as an alternative. The file /etc/selinux/fixfiles_exclude_dirs can contain a list of
directories excluded from relabeling.
fixfiles onboot will setup the machine to relabel on the next reboot.
OPTIONS -B If specified with onboot, this fixfiles will record the current date in the /.autorelabel file, so that it can be used later to
speed up labeling. If used with restore, the restore will only affect files that were modified today.
-l logfile
Save the output to the specified logfile
-F Force reset of context to match file_context for customizable files
-f Clear /tmp directory with out prompt for removal.
-R rpmpackagename[,rpmpackagename...]
Use the rpm database to discover all files within the specified packages and restore the file contexts. (-a will get all files in
the RPM database).
-C PREVIOUS_FILECONTEXT
Run a diff on the PREVIOUS_FILECONTEXT file to the currently installed one, and restore the context of all affected files.
-N time
Only act on files created after the specified date. Date must be specified in "YYYY-MM-DD HH:MM" format. Date field will be passed
to find --newermt command.
-v Modify verbosity from progress to verbose. (Run restorecon with -v instead of -p)
ARGUMENTS
One of:
check print any incorrect file context labels, showing old and new context, but do not change them.
restore
change any incorrect file context labels.
relabel
Prompt for removal of contents of /tmp directory and then change any incorrect file context labels to match the install file_con-
texts file.
verify List out files with incorrect file context labels, but do not change them.
[[dir/file] ... ]
List of files or directories trees that you wish to check file context on.
AUTHOR
This man page was written by Richard Hally <rhally@mindspring.com>. The script was written by Dan Walsh <dwalsh@redhat.com>
SEE ALSO setfiles(8),restorecon(8)
2002031409 fixfiles(8)