Removing old directories with logs

Posted by Mcgiwer on Stack Overflow See other posts from Stack Overflow or by Mcgiwer
Published on 2011-01-02T10:16:22Z Indexed on 2011/01/02 10:53 UTC
Read the original article Hit count: 168

Filed under:
|

My IM stores the logs according to the contact name. I have created a file with the list of active contacts. My problem is following:

I would like to create a bash script with read the active contacts names from the file and compare it with the directories. If the directory name wouldn't be found on the list, it would be moved to another directory (let's call it "archive"). I try to visualise it for you.

  • content of the list:

contact1
contact2

  • content of the dir

contact1
contact2
contact3
contact4

  • after running of the script, the content fo the dir:

contact1
contact2

contact3 ==> ../archive
contact4 ==> ../archive

© Stack Overflow or respective owner

Related posts about bash

Related posts about script