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

OIC - Sorting Unifier UDR Data by Latest Creation Date in OIC Using XSLT

  🔍 Use Case In an Oracle Integration Cloud (OIC) flow, we receive Unifier UDR report rows where the creation date is in MM/DD/YYYY HH:MM ...