Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
08-29-2013, 03:52 PM
|
#1
|
LQ Newbie
Registered: Aug 2013
Posts: 8
Rep:
|
I am an Oracle Database Administrator working in a SAS environment
i want to know what script to write to keep 14 days of the archive logs from my SAS server in a new folder.
|
|
|
08-29-2013, 04:30 PM
|
#2
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,428
|
Quote:
Originally Posted by aigberay
i want to know what script to write to keep 14 days of the archive logs from my SAS server in a new folder.
|
No idea...you're the administrator, aren't you? You can write a script in any one of MANY languages, and run it manually or automatically. How you write it depends on the language...a bash script is different than a perl script, so the syntax is different.
You can EASILY find many bash tutorials...start there..there's even one in my posting signature. Read the man page on the find command, and on the mv command.
|
|
|
09-11-2013, 12:43 PM
|
#3
|
LQ Newbie
Registered: Aug 2013
Posts: 8
Original Poster
Rep:
|
Need help urgently please!!!
i am comparing bab_grid_userlist.txt file to /etc/passwd file for user ids. If there is a user id in the bab_grid_userlist.txt file that does not have a Unix id in the passwd file I want it to send an email to babunixserver@vision.com. This should be setup as a weekly job that runs on monday mornings. please any help on this one.
|
|
|
09-11-2013, 12:54 PM
|
#4
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,428
|
Quote:
Originally Posted by aigberay
i am comparing bab_grid_userlist.txt file to /etc/passwd file for user ids. If there is a user id in the bab_grid_userlist.txt file that does not have a Unix id in the passwd file I want it to send an email to babunixserver@vision.com. This should be setup as a weekly job that runs on monday mornings. please any help on this one.
|
First, this is NOT URGENT for ANYONE here. If you need 'urgent' help, then contact Oracle support, since you're paying for it.
And now that we know what you WANT, why don't you show us what YOU have done to accomplish it, and tell us where you're stuck? We're not going to write your scripts for you. Also, there are many examples on how to set up a cron job to run every Monday you can easily find with Google:
http://linux.die.net/man/5/crontab
|
|
|
09-11-2013, 01:04 PM
|
#5
|
LQ Newbie
Registered: Aug 2013
Posts: 8
Original Poster
Rep:
|
Need help urgently please!!!
i am comparing bab_grid_userlist.txt file to /etc/passwd file for user ids. If there is a user id in the bab_grid_userlist.txt file that does not have a Unix id in the passwd file I want it to send an email to babunixserver@vision.com. This should be setup as a weekly job that runs on monday mornings. please any help on this one.
---------- Post added 09-11-13 at 01:04 PM ----------
i am comparing bab_grid_userlist.txt file to /etc/passwd file for user ids. If there is a user id in the bab_grid_userlist.txt file that does not have a Unix id in the passwd file I want it to send an email to babunixserver@vision.com. This should be setup as a weekly job that runs on monday mornings. please any help on this one.
Thanks for your post, i know the crontab would go like this:
>@weekly 0 9 * * 1 /bin/execute/this/script.sh
but i just need to put the remaining pieces together to achieve my goals, like sending the user in d bab_grid_userlist.txt that does not have a Unix id in the passwd file to the email, some help please.
|
|
|
09-11-2013, 01:14 PM
|
#6
|
LQ Guru
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 27,428
|
Quote:
Originally Posted by aigberay
i am comparing bab_grid_userlist.txt file to /etc/passwd file for user ids. If there is a user id in the bab_grid_userlist.txt file that does not have a Unix id in the passwd file I want it to send an email to babunixserver@vision.com. This should be setup as a weekly job that runs on monday mornings. please any help on this one.
Thanks for your post, i know the crontab would go like this:
>@weekly 0 9 * * 1 /bin/execute/this/script.sh
but i just need to put the remaining pieces together to achieve my goals, like sending the user in d bab_grid_userlist.txt that does not have a Unix id in the passwd file to the email, some help please.
|
Right...again, we understand what you WANT...but we will NOT write your scripts for you. AGAIN...post what script(s) you've written so far, and tell us where you're stuck. Until you do that, there's nothing we can help with.
So far, you've not shown that you've done ANY of the 'pieces'.
|
|
|
09-11-2013, 01:41 PM
|
#7
|
Moderator
Registered: May 2001
Posts: 29,415
|
Quote:
Originally Posted by aigberay
i want to know what script to write to keep 14 days of the archive logs from my SAS server in a new folder.
|
Try start with this?
Code:
which logrotate && man logrotate
|
|
|
09-12-2013, 04:12 AM
|
#8
|
Senior Member
Registered: Sep 2012
Posts: 1,385
|
You should post your code. There are different ways.
find and mv could be command useful for this issue.
Last edited by kooru; 09-12-2013 at 04:14 AM.
|
|
1 members found this post helpful.
|
All times are GMT -5. The time now is 01:12 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|