Newly installed drive changes ctime, what to do about rsync

Today I came across an interesting challenge. My primary web development and dirvish backup server has been eating up drive space. In turn the server has been acting sluggish, and I'm always trying to shuffle files to increase room, etc. I ended up bying a new Western Digital SATA harddrive to help me out.

I added the drive and configured the controller in the BIOS. My plan as to split the drive down the middle. 250GB for /var and the 250GB for the dirvish bank /bank.

Next I used rsync to archive move the files to preserve permissions to the new partitions. Then I removed the old directories and I was good times. The problem is this. I have a remote server that backs up my 'webs' and some client files using rsync over SSH. Well since I moved the files their ctimes changed, and now rsync wants to sync all files on my new partition. Not good. The link is DSL, and this would be several gigabytes over a tight wire.

I verified the ctime by using these arguments with ls

ls -alt /var

Clearly, I saw ctime of July 7th, and that's the problem. The solution was to change the ctime on the remote backup box so the backup box actually has 'newer' files that the source server. SSH'ing to my remote backup box, I navigated to the backup directory in /var/backups/hanji. Here I decided to use exec command in find to 'touch' all files and directories.

find /var/backup/hanji -exec touch {} \;

Now all files and directories show today, which is 'newer'. This solution works for me because I know that the backups are current and complete. If you're not sure, you may need a different solution