i have a requirement to delete records that do not belong to that day. For example in a file that came on July 31st ,2018 there are records that belong to Aug 1st,2018 as well and I want to find and delete those records. I want to delete anything with 01-Aug-2018. I have several files like that. I need a script that gets the first line second column that is date and add one day to it and delete that record.in this case all 1st Aug records should be deleted. Thank you in advance for your help.
Moderator's Comments:
Please use CODE tags as required by forum rules!
Last edited by RudiC; 10-10-2018 at 07:19 PM..
Reason: Added CODE tags.
i want to delete files that are one day old
condition is files should be of current month only ie if iam running script on 1 march it should not delete files of 28 feb(29 if leap year :-)}
any modifications to
find $DIR -type f -atime +1 -exec rm -f{}\; (4 Replies)
Hai all
i want to grep the particular pattern and move the mathing records to torget file and delete the matching recodrs from source file.
patterns are position based, like
13413432,aaaaaaa,dsfdddddd,34234324,22224555
13413432,aaaaaaa,dsfdddddd,12234324,11222455
i want to move the... (1 Reply)
I have a big file with "|" delimiter. I want to delete all the records that have 'abc' in the 2nd field. How can i do that? I am not abe to open it in VI that is why i need to do it from outside. Please suggest (6 Replies)
Dear All,
I am not able to remove the files in my AIX 5.3 server.
My files List
/iims-home/data/uat1/batch/staging
-rw-r--r-- 1 iims iims 5743 Jun 12 09:04 ErrorReport2008-05-20 09-04-18.doc
-rw-r--r-- 1 iims iims 191213683 Jun 12 09:05... (1 Reply)
Hi,
I have a file whose size is not zero but it has no records and another which has records. I want to delete all the files that have no records in it (even if size > 0). How do I do it?
I have tried the below option
#!/bin/ksh
temp1 = $(wc -l < INVX102C.sf)
if ; then
echo "Data... (3 Replies)
I have a directory /opt/targets which generates more than 1000 files per day and I want to delete all the files which are more than 1 day old...ie 24hrs+
Please help.. (3 Replies)
Hi Experts ,
At a particular dir , How to delete subirectories that are more than 1 day old AND have NO files in them.
PS : -empty option is not working at my Sun OS version.
Thanks,
A (6 Replies)
Hi,
Can any one help me...
the records are not deleting when I run the below script.
But if I issue the same delete command manually, the records are getting deleted.
script:
#!/bin/ksh
USAGE_STRING="USAGE $0 "
if
then
echo "SORRY you need to be user 'mqm'. Only 'mqm' has... (5 Replies)
My objective is to get the non matching records of previous day with current day.
eg, file1 contains
1 a
2 b
and file2 contains:
2 b
3 c
then expected output is
3 c¨
another example
file 1 contains:
1 a
2 b
file 2 contains
1 c
2 b (8 Replies)
friends
how I can delete files from a directory for the current date? (2 Replies)
Discussion started by: tricampeon81
2 Replies
LEARN ABOUT DEBIAN
fspy
fspy(1) User Commands fspy(1)NAME
fspy - filesystem activity monitoring tool
SYNOPSIS
fspy [options] [file/dir]
OPTIONS -F, --filter STRING/REGEX
a string or regular expression which will be used to filter the output. (the regex will be matched against the whole path e.g.
[/etc/passwd])
-I, --inverted STRING/REGEX
its the same like -F/--filter but inverted. you can combine both. e.g. -F '.conf' -I 'wvdial.conf' will filter for files with
".conf" in its name but without "wvdial.conf" in it.
-R, --recursive NUMBER
enables the recursive engine to look at a depth of NUMBER.
-A, --adaptive
(HIGHLY-EXPERIMENTAL) enables the adaptive mode. e.g. if new items will be added within the path fspy will automatically add those
items to the watch list.
-D, --diff VALUE
(EXPERIMENTAL) enables the diffing feature. VALUE may be a comma separated list of: s - element size (byte) A - last access time
(e.g. Mon Jul 21 21:32:31 2008) M - last modification time (e.g. Mon Jul 21 21:32:31 2008) S - last status change time (e.g. Mon Jul
21 21:32:31 2008) O - permissions (octal) U - owner (uid) G - group (gid) I - inode number D - device id
-T, --type VALUE
specifies the type of objects to look for. VALUE may be a comma separated list of: f - regular file d - directory s - symlink p -
FIFO/pipe c - character device b - block device o - socket default is any.
-O, --output VALUE
specifies output format. VALUE may be a comma separated list of: f - filename p - path d - access description t - element type s -
element size (byte) w - watch descriptor (inotify manpage) c - cookie (inotify manpage) m - access mask (inotify manpage | src/fsev-
ents.h) l - len (inotify manpage) A - last access time (e.g. Mon Jul 21 21:32:31 2008) M - last modification time (e.g. Mon Jul 21
21:32:31 2008) S - last status change time (e.g. Mon Jul 21 21:32:31 2008) O - permissions (octal) U - owner (uid) G - group (gid) I
- inode number D - device id T - date and time (for this event) (e.g. Tue Mar 25 09:23:16 CET 2008) e.g.: '[,T,], ,d,:,p,f' would
result in: '[Mon Sep 1 12:31:25 2008] file was opened:/etc/passwd' (take a look at the README).
-h, --help
this short help.
--version
version information.
AUTHOR
fspy is Copyright 2008-2009, Richard Sammet
This manual page was written by Giuseppe Iuculano <giuseppe@iuculano.it>, for the Debian project (but may be used by others).
fspy 0.1.0 January 2009 fspy(1)