adam.nz aboutpostsprojectscontact
# mv --update --backup=numbered bar.txt foo.txt
Only replace foo.txt with bar.txt if it's newer, and backup foo.txt to foo.txt~#~ before overwriting (where # is an ever incrementing number).