I've been given the task of checking the date of expiration dates and notify when the date is 30 days away from expiration.
As stated in the Title, I'm very new to this, I did a good bit of work over the last two days to only find out I was going down the wrong path.
I'm not expecting anyone to do my work for me, just a nudge in the right direction would be great. I'm sure someone will write it up exactly but.. you get the picture I want to learn not just copy and paste.
Example:
I can say, NOT knowing every command and all of the ways to use them is an issue but I guess it's something you pick up over time.
I am now on to trying a new approach with this...
Using this command is giving me the exact day number and I'm thinking this might be the best way to do it?
So if there was a way I could convert the "until: Thu Dec 06 13:35:34 EST 2011" portion to the +%j format, it might make it easier, no? If I can see that there is less than 30 days difference between the cur_date: xxx and exp_date: xxx it would be a bit easier?
Please state what Operating System and version you have and what Shell you prefer. With anything to do with "date" the solution will depend on whether you have the GNU version of the "date" command.
In this case it will also depend on whether you can plan for implementation in 30 days time.
System design problem.
Any chance of intercepting the process which writes these log entries?
If it can calculate 12 months in advance, can it calculate 11 months in advance (and write a timestamp file in a machine-readable format)?
Say I have this line:
read -p "Enter 3 numbers: " num1 num2 num3;
I want to write a while loop that repeatedly asks for input if the number of inputs entered is not equal to 3.
I don't know the correct command to find the number of inputs entered. Help, please? (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)
I need to check 1 log file, which is logging:
2014-08-18T09:10:39+02:00 user: XXXXX START FEATURE
2014-08-18T09:10:39+02:00 user: XXXXX FINISH FEATURE
I first need to check that the START FEATURE starts and finish on the same time/date for the same user, which is different each time START... (2 Replies)
I am trying to include a snippet in my script to check if the file created is having today's date.
eg: File name is : ABC.YYYYMMDD-nnn.log
The script should check if 'YYYYMMDD' in the above file name matches with today's date.
Can you please help me in achieving this.
Thanks in advance!! (5 Replies)
I have about 100 Linux servers running in Amazon EC2 (CentOS 6 based) and I need to run a 'date' command against all of them. Rather than logging into each individual server via 'ssh' and running the 'date' command, can someone please help me with how something like this can be scripted? I... (6 Replies)
Please help, I want script to check filename, size and date in specify path.
I want output as:
DATE: YYYYMMDD HH:MM
------------------------------------------------
fileA,filesize,yyyy mm dd HH:MM
fileA,filesize,yyyy mm dd HH:MM
fileA,filesize,yyyy mm dd HH:MM
fileA,filesize,yyyy mm dd... (1 Reply)
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)
Hello - I have written the following basic shell script to count files, compare files and look for a particular strings in a file.
Problem 1: How do I define more than 1 file location?
#!/bin/bash
#this is a test script
FILES=$(ls /home/student/bin/dir1, home/student/bin/dir2)... (0 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)
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)