Linux Copy Changed Files

I had a CentOS box that needed to backup files to another NAS system.

So I ran the following:
cp -rufT /source/dir/ /mnt/nas/dest/dir/
Everything copied without a hitch. I then edited one of the files and ran the copy command again. I was greeted with:

cp: overwrite ‘/mnt/nas/dest/dir/file’?

I forgot that CentOS, among other major providers, has an alias for the ‘cp’ command when running as root.

nano /root/.bashrc
Comment out the cp line
Rerun the copy command

Leave a Reply

Your email address will not be published. Required fields are marked *