I have a folder /home/storage/aggregate_data
with many sub-folders which in turn contain many files and sub-folders.
I want to copy all the files older than 90 days within the folder /home/storage/aggregate_data
to a new one /home/storage_new/aggregate_data
using find
command since the argument list can be long.
I'm using the command
find /home/storage/aggregate_data/* -mtime +90 \
-exec mv -v '{}' /home/storage_new/aggregate_data/ \;
The issue is for that some files the directory structure is maintained after moving while for some it is not.
For eg: the file originally in the path /home/storage/aggregate_data/rrc/rrc_daily/imsi_rrc/imsi_rrc_daily_2022_01_02.parquet
gets moved to /home/storage_new/aggregate_data/imsi_rrc_daily_2022_01_02.parquet
which is different from intended /home/storage_new/aggregate_data/rrc/rrc_daily/imsi_rrc/imsi_rrc_daily_2022_01_02.parquet
.
I have also tried
find /home/storage/aggregate_data/ -mtime +90 \
-exec mv -v '{}' /home/storage_new/ \;
Why is this issue happening to only some files and folders and not all?
How can I achieve my objective?