Jump to content

Trouble with simple copying on the command line


Guest johnKFT
 Share

Recommended Posts

Guest johnKFT

I am trying to set up a simple backup script to backup various bits like mail and bookmarks using the form - cp -uR --reply=yes ~/Mail/* ~/Mail-bak .

 

This works fine until I remove a file from a Mail folder. When I copy as above the removed file is still left in the backup folder. I cannot for the life of me figure out how to get this removed so that my backup folder is a simple carbon copy of my working folder. I am sure there is a simple explanation, but I cannot find it. Can anyone help please?

 

PS. When I get more experienced and have my setup properly organised I will compress all these backups. In the meantime I want to keep regular backups of such important and irreplaceable items as bookmarks and mails.

 

John

Link to comment
Share on other sites

Take a look to the rsync(1) command. Will do what you want.

 

Also there was an script made by TheYinYeti that will syncronize both directories the way you want. I don't know if there is a copy in this board, but sure that there is one on www.club-nihil.net/mub

Link to comment
Share on other sites

Guest johnKFT

Thanks Aru. I could not find The YinYeti's script but with a bit of fiddling and a few false starts (did not properly RTFM!) I now have rsync doing what I want.

 

John

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...