I have somefiles like
in a directory and so on..these files gets created every 3 hours where as first part of file name is date and second part is time.
however as its occupying more space on disk, its required to delete old files which we manually doing now...in such a way that only last 30 days backup files should be there, any file before that should be deleted
however we have a challenge even after clearing files before 30 days, still lot of disc filled, now idea is to keep only 1 file for any given day which is being last time stamp on that day and delete rest of files for that day , in such way I can retain one file for any day and free up some space.
for example , for 2018-7 -20, i can retain 20180720_2112.tar.gz -- assuming this the last backup for that day, delete rest 3 files ..in that way, i will have atleast one file of backup for a day and free up some space by deleting rest of the copies for that given day
Any idea how can i do it conditionally. Appreciate any help
Moderator's Comments:
Please use CODE tags as required by forum rules!
Last edited by RudiC; 08-28-2018 at 10:10 AM..
Reason: Added CODE tags.
How can I compare two decimal values within a function using Bash? Function fun2 isn't comparing the decimal values. Is there a way to do this using Bash or Korn?
#!/bin/bash
set -x
x=1
z=110
function fun1() { i=`bc << EOF 2>> /dev/null
scale=3
... (1 Reply)
conditional is not wworking
can any one figure out what goes wrong
xx1=`$ORACLE_HOME/bin/sqlplus -s apps/ostgapps1 2>/dev/null << EOF
WHENEVER SQLERROR EXIT 1
set head off feedback off ;
WHENEVER SQLERROR EXIT SQL.SQLCODE;
select count(*) from CMS_INVOICE_ALL... (2 Replies)
Hi,
I am new to unix and shell scripting.In my script,there is a line using the "if" conditional -
if && ; then
do something
Here "x" is a variable holding string value.If it is not equal to a comma or a string,only then I want to enter the "if" loop. But I am getting error while... (1 Reply)
Hi,
I am new to unix and shell scripting.In my script,there is a line using the "if" conditional -
if && ; then
do something
Here "x" is a variable holding string value.If it is not equal to a comma or a string,only then I want to enter the "if" loop. But I am getting error while... (12 Replies)
Hi all,
The following code is to find if a list of numbers from one file are within the range in another file.
awk -F, '\
BEGIN {
while ((getline < "file2") > 0)
file2=$3
}
{for (col1 in file2)
if ($0>=30 && $1<=45)
print $0} ' FILE1
But where I have the number 30 and 45, I... (3 Replies)
Hi,
I have a script like this:
sample.sh
mapping=$1
if
then
echo "program passed"
fi
I'm running the above script as ./sample.sh pass
The script is not getting executed and says "integer expression expected"
Could anyone kindly help me? (2 Replies)
Hi,
I want to perform a conditional search and remove my search string.
Input string: "abcdaabcadgfaarstab"
Character to search: "a"
Condition: Remove all "a" in the input string except if it is "aa"
Output string: "bcdaabcdgfaarstb"
Can you please help me in this? (5 Replies)
Here's an interesting (to me, anyway) little puzzle.
Background:
I have a process that restores a number of large(ish) files from tape backup. As an individual file is being written, it is owned by root, then the ownership is changed when that file is complete. Since this process can take... (3 Replies)
A portion of my input is as follows:
1087 IKON01,49 A WA- -1 . -1 . 0 W WA- -1 . -1 . 0 . -1 . -1 -1 -1 -1 -1 -1 W
1088 IKON01,49 A J.@QU80MW. 2... (2 Replies)
Hi
Please dont consider this as duplicated post..
I am using below pattern to find delete files to bringdown disc size.. however how i can make sure ist going to correct folder and searching for files... while print "echo rm " LastFile correctly print files names for deletion, but when i... (7 Replies)
Discussion started by: onenessboy
7 Replies
LEARN ABOUT PHP
shape_tar
SHAPE_TAR(1) General Commands Manual SHAPE_TAR(1)NAME
shape_tar - shapeTools RMS bundle up subsystem in a tar or shar archive
SYNOPSIS
shape tar[VERSIONS=<version_selection_rule>] [ARCHIVE=<filename>]
shape shar[VERSIONS=<version_selection_rule>] [ARCHIVE=<filename>]
DESCRIPTION
Shape tar and shape shar create a tar or a shar archive containing all source components of the current node in the system tree. All source
components listed in the COMPONENTS macro in the Makefile and the release identification file (VERSIONFILE) are written to the archive.
Components of subsystems are not included in the archive file.
The VERSIONS macro may be set to specify a version selection rule to be active during archive file creation. Default is most_recent,
selecting the most recent version of each component. See shape_stdrul(7) or the $(SHAPELIBPATH)/stdrules for other possible settings. You
may also use self defined version selection rules as VERSIONS.
ARCHIVE is the base name of the file where the output shall be written to. Default is $(SUBSYSTEMNAME). The output file gets the filename
extension .tar (resp. .shar). When ARCHIVE=- is given, data will be written to standard output.
SEE ALSO shape_RMS(1), shape_stdrul(7)FILES
$(SUBSYSTEMNAME).tar $(SUBSYSTEMNAME).shar
20.7.119SHAPE_TAR(1)