I want to transfer files which are older then 40 days from remote to local host. I am able to connect the remote server but unable to transfer the files from remote to local server. It results into error which says no files No such file or directory but the file exists on the remote hosts.
file=`sshpass -p "password" ssh username@server_ip "find /arch -type f -ctime -40"` sshpass -p "password" scp -r username@server_ip:$file /arch echo SCP Completed.
cp: cannot stat ‘/arch/file1.xls’: No such file or directory