we can not find the creation date what we can find is Last modified date which we find with 'ls -l ' option.
As you are deleting files I wud recommend to modify ur script a bit by adding two lines and appending the result into log file.Later you can check ur log file.
hi
i have following file.
where i m trying to retrive data on latest date.
let us say we are extracting data from this file for Jun 30 where date is highest date in log file.
here i want to take output in other file from first line of Jun 30 to the end of file
in short i want retrive... (5 Replies)
Hi
In my script, users have the option to delete files from a directory, however, I don't want them to be able to delete the automatically generated log file.
Is there anyway to lock a file from being deleted?
Note: The file can't be read only as it has to be written to quite frequently.
... (3 Replies)
Dear friends,
please tell me how to get some required lines from a file and write to another file using AWK command.
i.e.,
if a file contains,
abcdefghigk
12345
lmnopqrstuv
678910
wxyz
please tell me how to get lines(line count is always 2 and it's contineous) mentioned in blue... (1 Reply)
hi
i am new to shell scripting
i have a properties file like
hs=abc
hs1=def
hs2=ghi
now i want to retrive each value and assign it to a variable
like var1 = abc
please help (7 Replies)
Hello Everybody,
I'm facing a weird problem with the awk command.
I try to retrieve in a variable the value returned by a simple ls command.
ls /export/home/tmp |tail -1 return a good value (the name of the .
But When I try to execute the same command in a remote server using ssh as... (2 Replies)
Hi,
We have a file which needs supper user previleges to delete. There are 10 users having super user preveleges. Some times back that file got deleted. How to know who has deleted that file? (6 Replies)
Hello friends!!
I have a question regarding the use of ls in unix. I have a folder with files:
t1.txt
t2.txt
t3.txt
t4.txt
...
t10.txt
When I make an ls I always get:
t10.txt
t1.txt
t2.txt
t3.txt
..
t9.txt (2 Replies)
I am using aqua studio DB. I need to retrive the data from my database using uxin script in .csv format. i am using select query along with the joins. my o/p in the DB is of the below format.
Cycle IDCycle StatusRecord 98N-0000ACV23-3636FCliet Level (Af)Success1689393HF-J7879-09090RCliet Level... (1 Reply)
Discussion started by: Mugivz
1 Replies
LEARN ABOUT SUSE
savelog
SAVELOG(8) System Manager's Manual SAVELOG(8)NAME
savelog - save a log file
SYNOPSIS
savelog [-m mode] [-u user] [-g group] [-t] [-p] [-c cycle] [-l] [-j] [-J] [-1 .. -9] [-C] [-d] [-l] [-r rolldir] [-n] [-q] [-D dateformat]
file ...
DESCRIPTION
The savelog command saves and optionally compresses old copies of files. Older versions of file are named:
file.<number><compress_suffix>
where <number> is the version number, 0 being the newest. Version numbers > 0 are compressed unless -l prevents it. Version number 0 is
not compressed because a process might still have file opened for I/O. Only cycle versions of the file are kept.
If the file does not exist and -t was given, it will be created.
For files that do exist and have lengths greater than zero, the following actions are performed:
1) Version numbered files are cycled. Version file.2 is moved to version file.3, version file.1 is moved to version file.2, and so on.
Finally version file.0 is moved to version file.1, and version file is deleted. Both compressed names and uncompressed names are
cycled, regardless of -l. Missing version files are ignored.
2) The new file.1 is compressed unless the -l flag was given. It is changed subject to the -m, -u, and -g flags.
3) The main file is moved to file.0.
4) If the -m, -u, -g, -t, or -p flags are given, then an empty file is created subject to the given flags. With the -p flag, the file
is created with the same owner, group, and permissions as before.
5) The new file.0 is changed subject to the -m, -u, and -g flags.
OPTIONS -m mode
chmod the log files to mode, implies -t
-u user
chown log files to user, implies -t
-g group
chgrp log files to group, implies -t
-c cycle
Save cycle versions of the logfile (default: 7). The cycle count must be at least 2.
-t touch new logfile into existence
-l don't compress any log files (default: do compress)
-p preserve owner, group, and permissions of logfile
-j compress with bzip2 instead of gzip
-J compress with xz instead of gzip
For xz no strength option is set, and xz decides on the default based on the total amount of physical RAM. Note that xz can use a
very large amount of memory for the higher compression levels.
-1 .. -9
compression strength or memory usage (default: 9, except for xz)
-C force cleanup of cycled logfiles
-d use standard date for rolling
-D dateformat
override date format, in the syntax understood by the date(1) command
-r use rolldir instead of . to roll files
-n do not rotate empty files
-q be quiet
BUGS
If a process is still writing to file.0, and savelog moves it to file.1 and compresses it, data could be lost.
SEE ALSO logrotate(8)Debian 30 Dec 2017 SAVELOG(8)