Search Results

Search: Posts Made By: prince1987
3,015
Posted By Scrutinizer
The correct syntax would be something something...
The correct syntax would be something something like this, using arithmetic evaluation:
if (( dm > 0 || cl == 100 || ad == 0 || me > 8 || cp > 0 )); then

or if you want to use the test utility,...
4,097
Posted By rbatte1
Have you investigated the logrotate command and...
Have you investigated the logrotate command and configuration? That might save you having to craft your own. You can force a rotation based on several criteria as it suits your needs.



Robin
4,097
Posted By rdrtx1
try adding to cron: 00 00 * * * test $((...
try adding to cron:
00 00 * * * test $(( ($(date +\%s)/24/60/60) \% 45 )) = 0 && /path_to_script/clean_up_script
4,097
Posted By vbe
ever considered using at command? The idea in...
ever considered using at command?
The idea in your job execution, to do self execution by calling itself in 45 days using at...
I dp that sometimes...
3,378
Posted By rdrtx1
See updated post #2.
See updated post #2.
3,378
Posted By RudiC
With bash, try printf "%0${#LOGNUM}d\n" "$((...
With bash, try
printf "%0${#LOGNUM}d\n" "$(( 10#$LOGNUM - 1 ))"
0000094
3,378
Posted By Don Cragun
When you post questions like this in the future,...
When you post questions like this in the future, please tell us what operating system and shell you're using!

If you're using ksh, the easy way to do it is:
LOGNUM=0000095
OLDLOG=$(printf "%07d"...
3,378
Posted By Don Cragun
I doubt that it is working for all numbers below...
I doubt that it is working for all numbers below 99. And, you haven't told us what shell you're using to get these results. The above output is exactly what I would expect if you're using bash as...
3,378
Posted By rdrtx1
LOGNUM=0000095 printf "%0${#LOGNUM}d\n" $(echo...
LOGNUM=0000095
printf "%0${#LOGNUM}d\n" $(echo "$LOGNUM-1" | bc)
3,378
Posted By RudiC
Does it have to be bc? Try awk -vLNUM=$LOGNUM...
Does it have to be bc? Try
awk -vLNUM=$LOGNUM 'BEGIN {printf "%07d\n", LNUM-1}'
0000094
908
Posted By jim mcnamara
find . mtime +2 -type f \( -name '*.LOG' -a !...
find . mtime +2 -type f \( -name '*.LOG' -a ! -name S0000000.LOG \) -exec rm {};

Assuming I got what you want try this. Just do not run the exec part until you are sure it does what you want....
1,422
Posted By Aia
It all depends what you are going to do with it....
It all depends what you are going to do with it. As an example this does:

perl -nle '/CURDEPTH\((\d+)\)/ and print $1' prince1987.file

Edit: Added a + to accommodate that a number could be more...
Showing results 1 to 12 of 12

 
All times are GMT -4. The time now is 07:15 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy