I want to save old files to another directory. To the directory that mounts cheap storage.
Like this.
#Moving source
/home/hogehoge/aaa/file1 2019/12/24 Update ← Move this. old
└ file2 2020/12/24 update ← This is as it is. new
#Destination
/cheep/backup/
here
/cheep/backup/aaa/file1
I want to be like this!
Use rsync.
cd /home/hogehoge
rsync --remove-source-files -t -p -R $(find ./ -type f -mtime +365) /cheep/backup/
There must be a better way. .. .. Someone tell me.
Recommended Posts