issue while moving files using find command

Hi Friends,

I'm facinf issue while moving large files using find command.I've a scenario like i've to move one day older files from one directory to anothe directory.I'm using the below command.

find $src_dir -name error -prune -o -type f -mtime +1 -exec mv {} $dest_dir \;

some times it's not working.particularly it's not working for large files.It 's throwing the below error

mv: dest_dir/file_name: A file or directory in the path name does not exist

pls help me friends to solve this.i wnat to know why it's acting like this...:wall:

@mail2mura
Please edit you post to remove typing errors. The command looks unlikely (with the #) and the error message is impossible (with the $).

Addenda:
If $dest_dir is a subdirectory of $src_dir there is considerable scope for this script to go wrong.

1 Like