timestamp query - Redhat

This is a discussion on timestamp query - Redhat ; Is there a command to query the time stamp? I am working a script where anything within the last 30 days will be moved to a folder and then burnt to the cd. By running the script. The next month ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: timestamp query

  1. timestamp query

    Is there a command to query the time stamp? I am working a script where
    anything within the last 30 days will be moved to a folder and then
    burnt to the cd. By running the script. The next month will delete the
    files that where moved the previous month and move the new ones and burn
    the new cd.



    Do you have any ideas how I can query the time to do this? I have been
    looking and trying a few things but no luck. I am not very familiar with
    grep is that a possibility?


  2. Re: timestamp query

    nick britton wrote:
    > Is there a command to query the time stamp?


    What's a "time stamp"?

    If you mean the date of last change of a file, use "ls -l". Or are you
    asking for some less general command? Maybe "date -r foo"?

    > I am working a script where
    > anything within the last 30 days will be moved to a folder and then
    > burnt to the cd.


    "man find".

    > Do you have any ideas how I can query the time to do this? I have been


    Sure. Man find.

    Peter

  3. Re: timestamp query

    On Tue, 18 May 2004 11:48:25 -0500, nick britton wrote:

    > Is there a command to query the time stamp? I am working a script where
    > anything within the last 30 days will be moved to a folder and then
    > burnt to the cd. By running the script. The next month will delete the
    > files that where moved the previous month and move the new ones and burn
    > the new cd.
    >
    > Do you have any ideas how I can query the time to do this? I have been
    > looking and trying a few things but no luck. I am not very familiar with
    > grep is that a possibility?


    info date:

    Examples of `date'
    ------------------

    Here are a few examples. Also see the documentation for the `-d'
    option in the previous section.

    * To print the date of the day before yesterday:

    date --date='2 days ago'

    * To print the date of the day three months and one day hence:
    date --date='3 months 1 day'

    Something like the above gives you the proper date to use. The use "find"
    to find the proper files (see "info find")

    --
    Bas.



+ Reply to Thread