Scythe Posted July 17, 2007 Report Share Posted July 17, 2007 (edited) Im trying to set up a simple rsync script to copy from one hard drive to another local backup hard drive. The drives are as follows: \media\storage1 \media\storage1b where storage1 is the main HD and storage1b is the backup. I want this to do the backup whenever I tell it to and I want it set so that what ends up being on storage1b is the exact same as storage1. I dont want the backup drive to keep files that Ive deleted on the primary drive. At the moment Ive just run rsync -av \media\storage1\ \media\storage1b\ and its building the file list, so I dont know what itll do at the end. By the way, anyone know why everytime I press the apostrophy and the backslash key while using the writer on this board that the QuickFind keeps popping up? My arrow keys and Home\End keys dont work either. [moved from Software by spinynorman] Edited August 9, 2007 by Scythe Quote Link to comment Share on other sites More sharing options...
aioshin Posted July 17, 2007 Report Share Posted July 17, 2007 building fileslist... You may just have to wait.. that might be due to large storage being backup, that was why the waiting time took longer... Quote Link to comment Share on other sites More sharing options...
jkerr82508 Posted July 17, 2007 Report Share Posted July 17, 2007 (edited) I dont want the backup drive to keep files that Ive deleted on the primary drive. You may need to add the --delete option to the rsync command. What I did when I started using rsync was to run grsync. This is a gui which let's you select some of the most common options. Importantly, it displays the command line that it creates for you. You can then look up the options that are being used, in the man page, to better understand them. (The man file for rsync is, I found, rather daunting to read through, unless you know what you're looking for.) It's probably also a good idea to set up a test folder, and run the command on that first. rsync also has the -n parameter which will cause rsync to do a "dry run". It will report what it would do without actually doing anything. Jim Edited July 17, 2007 by jkerr82508 Quote Link to comment Share on other sites More sharing options...
theYinYeti Posted July 17, 2007 Report Share Posted July 17, 2007 You may want to look at this post and the following posts too, related to rsync backups and backup in general: https://mandrivausers.org/index.php?s=&...st&p=315575 Yves. Quote Link to comment Share on other sites More sharing options...
Scythe Posted July 18, 2007 Author Report Share Posted July 18, 2007 You may need to add the --delete option to the rsync command. What I did when I started using rsync was to run grsync. This is a gui which let's you select some of the most common options. Importantly, it displays the command line that it creates for you. You can then look up the options that are being used, in the man page, to better understand them. (The man file for rsync is, I found, rather daunting to read through, unless you know what you're looking for.) It's probably also a good idea to set up a test folder, and run the command on that first. rsync also has the -n parameter which will cause rsync to do a "dry run". It will report what it would do without actually doing anything. Jim Yeah, I was trying to read the rsync man page and just got more confused. I'm trying to install grsync, but compiling it from the tarball says I need GTK+-2.0, which I could swear is already installed. And I can't find a Fedora RPM for it just yet, but I'm still looking. You may want to look at this post and the following posts too, related to rsync backups and backup in general:https://mandrivausers.org/index.php?s=&...st&p=315575 Yves. I was reading this earlier but I can't decipher the scripting. Scripting isn't my forte, that's for sure. Quote Link to comment Share on other sites More sharing options...
theYinYeti Posted July 18, 2007 Report Share Posted July 18, 2007 You don't have to understand the script (although you can if you want) ;) Just save the script, run it with the -h parameter (help), and if you see any use to it, configure CRON or ANACRON to execute it when you want (Mandriva has a GUI for cron in the MCC). I wanted to upload the script, but it seems I'm "not permitted to upload this type of file"... Yves. Quote Link to comment Share on other sites More sharing options...
mystified Posted July 18, 2007 Report Share Posted July 18, 2007 There's a program called mirdir that is perfect for what you want. It's very easy to use and it compares your backups to the original and makes an exact duplicate. I don't know if it's available in easy-urpmi or not but here's a rpm for it. http://sourceforge.net/project/showfiles.p...ckage_id=146026 I just set it up as a cron job on my gentoo box and don't have to worry about backups. Quote Link to comment Share on other sites More sharing options...
pmpatrick Posted July 18, 2007 Report Share Posted July 18, 2007 Here's a recent article on rsync usage: http://www.linux.com/feature/117236 You should also not that if you are backing up a linux filesystem to a FAT32 filesystem you can run into problems since FAT32 does not support owners, groups, symbolic links, etc. To get around these problems and not get a ton of error messages use this: rsync -rvt --modify-window=1 --delete instead of: rsync -av --delete when backing up a linux filesystem to a FAT32 fielsystem with rsync. Quote Link to comment Share on other sites More sharing options...
Scythe Posted August 7, 2007 Author Report Share Posted August 7, 2007 (edited) I found that mirdir works like a charm for what I need. Is there any way to get it to something like a program shortcut so that I don't have to type it in the command line each time? All I need it to do is run the command: mirdir -e none /media/storage1 /media/storage1b And the way I have my hardware set up I can't run it as a cron job. Edited August 7, 2007 by Scythe Quote Link to comment Share on other sites More sharing options...
mystified Posted August 8, 2007 Report Share Posted August 8, 2007 You can open up a text editor and type in mirdir -e none /media/storage1 /media/storage1b and save it with an .sh extension. Then all you have to do is type in sh script.sh and it will run for you. Quote Link to comment Share on other sites More sharing options...
Scythe Posted August 9, 2007 Author Report Share Posted August 9, 2007 So if I do a "Link to Application...", set the work path to where I saved the script, and set the command as "sh script.sh" it should run the script? Will it open up a terminal to do this? I like the verbose mode when backing my stuff up. It's nice to know what's going on ;-) Quote Link to comment Share on other sites More sharing options...
mystified Posted August 9, 2007 Report Share Posted August 9, 2007 I keep my scripts in a folder (aptly named) scripts in my home directory and then I just open a terminal and cd into it and then just run sh script.sh and you can watch it do it's work. Sorry if I wasn't clear before. :) Quote Link to comment Share on other sites More sharing options...
spinynorman Posted August 9, 2007 Report Share Posted August 9, 2007 So if I do a "Link to Application...", set the work path to where I saved the script, and set the command as "sh script.sh" it should run the script? You should be able to create a shortcut without using the script. Just put the mirdir command in the command line. Will it open up a terminal to do this? I think there's an option to open a terminal when you create the shortcut - not in Linux at the moment... Quote Link to comment Share on other sites More sharing options...
Scythe Posted August 9, 2007 Author Report Share Posted August 9, 2007 You should be able to create a shortcut without using the script. Just put the mirdir command in the command line. I think there's an option to open a terminal when you create the shortcut - not in Linux at the moment... I thought I tried that and it didn't work...obviously not. I just tried it and it worked great. The option is under "Advanced Options." Thanks everyone for the help. Case closed. Quote Link to comment Share on other sites More sharing options...
spinynorman Posted August 9, 2007 Report Share Posted August 9, 2007 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.