Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2005
    Posts
    6

    Unanswered: I need to move files by hour, it is possible?

    I have to make a script that copy files created in last hour.
    It is possible?

    CTIME= ???
    find . -name "$CFILES" -mtime +$CTIME -exec cp -p {} "$CDIR/tmpold" \;

  2. #2
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    +n for older than n
    -n for newer than n
    To find within last hour
    use -cmin -60 if your version of find support it
    else use touch -t to create a temp_file with a time of one hour ago
    then use find's -newer temp_file

  3. #3
    Join Date
    Oct 2005
    Posts
    6
    Thanks pdreyer.

Posting Permissions

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