Find the answer to your Linux question:
Results 1 to 2 of 2
If this need to be in the scripting/programming area please move..sorry I have a problem where I usually have 4 file in a directory 1-complete from yesterday,1- tgz from yesterday ...
  1. #1
    Linux Newbie
    Join Date
    Jun 2006
    Posts
    139

    How do I ????????

    If this need to be in the scripting/programming area please move..sorry

    I have a problem where I usually have 4 file in a directory
    1-complete from yesterday,1- tgz from yesterday
    1-complete from today ,1- tgz from today
    I need to keep todays complete and tgz file and remove yesterdays as I ftp yesterdays files to another site.
    I have a script that does this but sometimes the dba gets in and messes things up causing only todays files to be there. When cron runs it then deletes the current file(s) and I am left with nothing. I thne have to go out create the files and all is good again with the world.
    Is there a way to examine the directory and if there are less that 4 files in it stop the cleanup of files.
    The complete files have the same name with the excetion being the date and time of creation, the same goes for the tgz files.
    Any help is greatly appreciated
    Mace

  2. #2
    Linux Newbie
    Join Date
    Jun 2006
    Posts
    139
    I've looked all morning get back ask the q ..look again and find the answer

    ls -A1 /path/to/folder | wc -l

    mace

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...