backup windows drive with cp

July 13th, 2007 mysurface Posted in cp | Hits: 39005 | 1 Comment »

You can write a simple scripts to copy data from windows machines through samba, with simple command cp perform daily or weekly. One thing I would like to highlight here is the -u parameter. With -u parameter, cp will only perform the copy action if the source file is newer then the destination file.

For example, you have mount your windows drive to /mnt/win/db_svr, and wanna back the entire folder, you can do this.

cp -ruf /mnt/win/db_svr /var/backup/db_svr

For Mounting windows drive through samba, check here.

With r is recursively and f is force, this will perform fine backup, if u put this line into crontab.

But too bad, scp do not have -u option, to do backup of linux, we can use rsync.

One Response to “backup windows drive with cp”

  1. [...] If you are interested to learn more complex filter rules, do read the FILTER RULES and INCLUDE/EXCLUDE PATTERN RULES in rsync’s man page. Related Posts backup windows drive with cp You can write a simple scripts to copy data from windows machines through samba, with simple command cp perform daily or… [...]

Leave a Reply