Tuesday, March 9, 2021

Shell script to move files older than 10 days

A small script to move file from one directory to another.

step1: Create a file with name file_move.sh

    for i in $(find  absolute_path_from_move -type f -name "*"  -mtime +10 2> /dev/null);

    do

    mv $i archive_path;

    done

step2: execute with Command 

    sh -x file_move.sh

No comments:

Post a Comment

Featured Post

11g to 12c OSB projects migration points

1. Export 11g OSB code and import in 12c Jdeveloper. Steps to import OSB project in Jdeveloper:   File⇾Import⇾Service Bus Resources⇾ Se...