To create a script and schedule which purge 30 days old files

Hi Friends,
Very new in Unix and i got a requirement like writing a script and schedule it, so that it removes 30 days old files from all the log locations of a unix box.
Suppose i have a unix server ltbamdev1 and in this server i have a mount point opt/bam. In this mount point i have 3 different folders like
/ltbamdev1/oracle/install/product/10.1.3.1/OracleAS_1/opmn/logs
/ltbamdev1/oracle/install/product/10.1.3.1/OracleAS_1/bpel/domains/default/logs
/ltbamdev1/oracle/install/product/10.1.3.1/OracleAS_1/bpel/domains/support/logs
Please help me in writing a script which runs once a week and removes all 30 days old files from these three folder locations.
Thanks in advance
Duos

Moderator Action:
The discussion is in the duplicate cross-post:
To create a script and schedule which purge 30 days old files
@O.P.
For the future, only make one post.
If it is in the wrong forum, it will likely get relocated by moderators.
This duplicate is now locked to prevent responses getting fragmented all over the place.

Similar Messages

  • Creating a job and scheduling a job error in OEM

    Hi, Everyone,
    I am trying to create and schedule a job thru OEM. In the the pl/sql block provide i have given my code like this
    begin
    SET SERVEROUTPUT ON;
    SPOOL C:\RFV_PROFILE_REPORT.LOG APPEND;
    SELECT TO_CHAR(SYSDATE, 'DD/MM/YY HH24:MI:SS') FROM DUAL;
    EXEC PAC_RFV_PROFILE_REPORT.CALL_ALL (200910);
    SELECT TO_CHAR(SYSDATE, 'DD/MM/YY HH24:MI:SS') FROM DUAL;
    SPOOL OFF;
    end;
    i have created the job and scheduled it but i am getting this error:
    Error # 6550
    Details ORA-06550: line 2, column 5: PL/SQL: ORA-00922: missing or invalid option ORA-06550: line 2, column 1: PL/SQL: SQL Statement ignored ORA-06550: line 3, column 7: PLS-00103: Encountered the symbol "C" when expecting one of the following: := . ( @ % ;
    could anyone pls help as this is very urgent.
    Thanks in advance

    Ah, the problem is you are confusing SQLPlus commands with PL/SQL.
    SET SERVEROUTPUT ON; -- This is a SQLPlus command, not necessary here.
    SPOOL C:\RFV_PROFILE_REPORT.LOG APPEND; -- This is a SQLPlus command, in PL/SQL to write out to a file you will need to call the UTL_FILE package to open a file for writing to. Except that the file you write to will appear on the database server, not your workstation, when the scheduled job runs.
    SELECT TO_CHAR(SYSDATE, 'DD/MM/YY HH24:MI:SS') FROM DUAL; -- In PL/SQL you need to SELECT columns INTO variables FROM tables. But in fact I guess you want to write the time to file using UTL_FILE again. However, you don't really need to do this, since scheduler will log the start time and run duration itself.
    EXEC PAC_RFV_PROFILE_REPORT.CALL_ALL (200910); -- This is the SQLPlus equivalent of the PL/SQL command:
    BEGIN
    PAC_RFV_PROFILE_REPORT.CALL_ALL (200910);
    END;
    SPOOL OFF; -- This is a SQLPlus command, not necessary here.
    So to summarise, all you really need is:
    BEGIN
    PAC_RFV_PROFILE_REPORT.CALL_ALL (200910);
    END;
    And the scheduled job will log the start time and duration in the database, which you can find here:
    SELECT * FROM USER_SCHEDULER_JOB_RUN_DETAILS

  • IWork apps no longer sync with iCloud. I am on iOS 5.1,1, and this problem is several days old, before it was working fine. Anyone has an idea?

    iWork apps no longer sync with iCloud. I am on iOS 5.1,1, and this problem is several days old, before it was working fine. Anyone has an idea?

    Sadly this is not a new problem and I would not expect a forthcoming solution.  I bought an iPad 3G and the iWork suite at the end of August and iCloud syncing worked fine.  About the time Apple rolled out iOS 6 the syncing stopped working for me (without me upgrading or changing anything).  It has never really worked since.   Run iOS 5.1.1 on both the iPhone 4 and iPad 3G.  The "geniuses" claim that Apples iOS 5 requirement is not correct and that I MUST upgrade both to ios 6 (although I know for fact that lots of folks STILL have the iCloud probs even with its 6.  The last genius basically shrugged and non-verbally acknowledged the iCloud/iWork failing and suggested "just use Dropbox.". So why the **** did we pay for iWork!?!?!
    Basically the  iwork/iCloud Connnection is broken and I have yet to get a viable solution to repair the issue.  Sorry for the bad news.  For reference I have uninstalled/installed each iteration of iWork upgrades on each device without success.  I have reset all settings multiple times, turned iCloud off/on repeatedly etc etc without success.  I even wiped the iPad and restored from iCloud w/o intention (another Apple IPad "glitch" when I tried the "reset all settings" and the iPad decided to "erase all" instead.  The genius said "it happens.")
    Oddly, the Pages app is the only one that has marginally worked at times since the first probs.  However it is basically broken and non-functioning.  Certainly DO NOT trust vital documents to iCloud/iWork.  I lost a number of work critical docs in this whole annoying, messy process of trying to get what Apple promised as easy....

  • My ipad mim with retina display isnt responding at all and it's only 2 days old, what do I do?

    My ipad mim with retina display isnt responding at all and it's only 2 days old, what do I do?

    It's not turning on at all, it turned off and won't respond to any buttons. I've tried to charge and all it does it turn on to the apple screen than turn back off, and does this the whole time while on the charger. I tried recoverying it through itunes also, and that didn't work either.

  • Creating a job and schedule

    Hi,
    working in oracle database 9i. I need to know how to create a job that runs a stored pl sql procedure and schedule it.
    I have created a job via toad but it doesn't run by itself. .
    what am i missing?

    http://docs.oracle.com/cd/B19306_01/appdev.102/b14258/d_job.htm

  • When comparing scripts and smartforms which is better

    hi can you please help out the advantages and disadvantages of scripts and smartforms

    Welcome to SCN.
    Please read forum rules (you'll see that you must search the forum first (your question is already answered))

  • Error creating folder /scripts and /css with 'upload to ftp host'

    We have had a website designed for us, although I personally would like to update the website as and when needed.
    During the upload to the ftp host at 82% an error message appears regarding the creation of folder /scripts and after pressing resume, another reading /css.
    Once finished the live site is a complete mess. If someone can help expalin simply what is going on and how i can fix this problem.
    Thanks
    Ben

    Refer to a similar thread here with a possible solution to the problem.
    http://forums.adobe.com/message/5082790
    Thanks,
    Vinayak

  • Users created through script - and being provisioned through another way

    Hi,
    I have users from partners, being created by me and also being provisioned by Oracle Channel.
    Ones I delete mine, the others get deleted from the system - and not just from my folders etc.
    Is there a way that we can prevent the deletion form the Workspaces that had been created & provisioned by the Channel Manager?
    Regards, Daniel

    Daniel,
    Odd. Bert should be OK even if you delete the first Workspace.
    The way BeehiveOnline works this would only happen if you removed Bert from the group and thereby removed his rights to access any content.
    A normal workspace setup would be a single workspace - controlled by the system - named GroupName_Workspace with all the members of the group in it.
    If you now create a second or third workspace you can select to add users from your group to these workspaces - taking them in or out of the workspaces should have no effect - it is the Group and associated ACL structure that governs access. The only way this may happen is if you use the workspace A.participants group to add members to Workspace B. Removing Workspace A will remove the Workspace A.participants group from Workspace B - or at least make it empty if not removed - same effect.
    So does that make sense? There must be something else going on with Bert that is not obvious from your description.
    Phil

  • Create a script to save multiple groups into seperate png files

    Hello,
    I want to use a script to save every group I made into a '.PNG. I'm visualizing something like this, but the outputformat/name doesn't matter, as long it is a output from a group:
    group1 -> 1.png
    group2 -> 2.png
    group3 -> 3.png
    group4 -> 4.png
    etc.
    I noticed that someone create a script like that, but it isn't using for me anymore. Find here the script that isnt working for me:
    Re: Export Groups to Files?
    I am using Photoshop CC 2014 on Windows 7 (64bit).
    Looking forward to your reply! Thanks.
    Kind regards,
    Joost

    Which code cpu you use and what does
    but it isn't using for me anymore.
    mean exactly?

  • Remove unnecessary transport requests which are 7 days old

    Hi All,
    I would like to delete all the un-necessary transport requests which are displayed in STMS which are more than 7 days old.
    But, the import log should be available whenever i need to verify.
    Is there any script which can do this?
    Thanks
    Vijay

    Hi,
    I do have a similiar situation, I would like to write a script to remove transports that have successfully transported and are over 7 days old.   In STMS currently we have a list of every transport that has ever been sent and there is no need.  Note that via SE10 we still want to see transport history even for old transports just remove the old ones from STMS. Hopefully I feel some script does this job and no idea on this scripts.
    Can someone throw light on this and help me out.
    Thanks & Regards,
    Bharadwaj.

  • I bought a new ipod touch because I lost my old one and I want to put my old files from icloud on my new one, but how?

    I bought a new Ipod touch 5G because I lost my old one and I want to put all my old files, who are supposed to be uploaded on icloud, on my new one but I have no idea how? Who can help me?

    See here: iCloud: Backup and restore overview
    B-rock

  • What is creating customer online and in which scenario that will be used?

    HI BUDDIES
    WT IS THE DIFFERENCE BETWEEN THESE TWO BAPIS
    BAPI_CUSTOMER_CREATE
    BAPI - BAPI_CUSTOMER_CREATEFROMDATA1 
    REGARDS
    HARI

    The TCP Open does have inputs for specifying both local and remote ports.
    Message Edited by Dennis Knutson on 08-23-2007 09:52 AM
    Attachments:
    TCP Open.PNG ‏11 KB

  • Create SSRS report using Schedule Perfomance Index(SPI) from mpp file

    Hi,
    We have project server data available in sql server. We need to create SSRS report to show schedule performance Index(SPI) of each week of all the projects. So we have the TaskSPI data available in MSP_EPMTask_Userview table. But the corresponding project
    status date is represented once for each projects. Is the weekly status dates keeping anywhere in the database? How can achieve this functionality?
    Regards,
    Julie

    Hi Julie,
    SPI is calculated at task level and is also a timephased indicator (since BCWP and BCWS are also timephased). There are calculated based on the status date (project tab in the ribbon) which is at project level. The project status date is not kept in
    time, this is a unique value thus you do not have a weekly status date.
    Do you mean you want to keep an history of each value of the status date? Does it really make sense?
    Hope this helps,
    Guillaume Rouyre, MBA, MVP, P-Seller |

  • Create Business partner and Sales order automatic based on Excel file

    Hello everyone,
    Can anyone help me with the following.
    I need to create automatic Business partner master data and the Sales order in Business One based on the input list from one Excel file.
    Before the new automatic Sales order should to be created  the system need to create first the BP and then the Sales order using the new created BP.
    Is it possible to use some tools like CATT or LSMW for this reason.
    If yes can you please help me with a sample/
    Thanks and regards.

    use DTW (data transfer workbench ) or if you want to automate the entire thing, then an add-on using the DI is best.

  • Unix shell - how to remove files in the cron which are N days old

    Hey guys:
    I know it's unix question rather then oracle.
    I have to gzip my archive logs due to the lack of space. Because of that, RMAN command "delete noprompt obsolete" (on the cron) does not delete the gzipped arch logs and I have to do it with rm command.
    I have this line in my file which runs on cron:
    find /db/oraarch/PROD1/arch*.arc.gz -mtime +2 -print |xargs rm
    It sends an error:
    Subject: cron
    Usage: rm [-Rfir] file ...
    Cron: The previous message is the standard output
    and standard error of one of your crontab commands:
    Any suggestions - maybe even to somehow delete compressed arch logs from inside RMAN?
    TIA,
    Greg

    Greg, what about:
    find /db/oraarch/PROD1/arch*.arc.gz -mtime +2 -exec rm {} \;
    If this does not work then trying adding the -f option to rm to supress messages
    HTH -- Mark D Powell --

Maybe you are looking for

  • Upgrading Tiger 10.4.11 to Snow Leopard...how do I back up everything first

    I'm going to be upgrading to Snow Leopard, but I'm concerned about backing everything up. I just got an external drive but I don't know what to do to get all of my files onto it before upgrading just in case the upgrade loses all my docs and pics. Sh

  • Problem installing Oracle9i Database

    When i installed the software, it got through to almost 50%, but then the installer screen suddenly disappeared off the screen and my pc shut-down and restart automatically. I don't know what was the problem because there wasn't even an error message

  • How to ensure BSEG is in synch with the fagl tables?

    We currently have a customer field that is present in BSEG ang FAGLFLEXA nad FLEXT. During posting / initial creation of documents, the field called product assignment (different from the product  assignment already available) if left blank is subsit

  • Integrating AE workflows in CC

    Hi, I am currently implementing CC and AE 5.2 and I was looking for some info on the integration between the 2. My client wishes to do yearly "full system" reviews using only CC 5.2. When it comes to mitigation, CC needs AE to trigger workflows, but

  • Need Document Fonts in .TXT format

    Hi All, I am trying a script which is in "InDesignCS3_ScriptingGuide_JS" related to font list. My requirement: How can we get documents font list in .txt format. Trying Code is below: //To display font name (working fine) var myDocument = app.activeD