• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

Easier way of doing this

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

Enablingwolf

Senior Member overclocking at t
Joined
Jun 14, 2004
I am restoring off all of my backup dvd's. Due to a dumb boo boo on my part. :bang head
I am wanting to make the files 777 so it is easier until all the data is in place. Then I will reset the permissions as I need. I have many dupes and they are not deleting/moving easy and other fun stuff. I am doing all this via two computers. Since It gives me two more DVD drives to drop data from. 4 HD's and 3 dvd drives makes for fast work. Just hte permissions are slowing me up./ Plus Me doing it all slow like.
So I am doing this...
Pull off dvd. (one folder at a time or grups of folder, simply put. A dvd's worth.)
sudo chmod 777 /where/the/dat/is/held -R
Then I move it.
cp in/this/folder /to/the/destination_folder(each one is unique)

What I would like to to, after it is on the HD. Is to change the permissions before I move the stuff around, or afterwards. Don't matter really. Long as the end result allows me to not have the hassle of root permissions. At least until I got the data in it's place. Then I can reset the permissions as needed later on.

So how can I make this one easy command line step? Also how would I move specific multiple folders to specific destinations?

Like:
folder_1 to music on one drive and folder_ to pictures on another.. in one step? It would actually be more than two folders and multiple separate unique destinations.
 
Last edited:
I think that moving folders would be hard to do in one step, however if the folder names are similar you can use wildcards to move multiple folders.
You might be able to make a script to move automate this some too. I haven't had the opportunity to use them much, but i found this neat begginer's guide here.
For setting the permissions you could add it into the script that when a folder is moved you change permissions on the moved folder.
If you are moving a lot of unique data you might have an easier time using a graphical interface instead of the CLI (Knoppix here we come!)
By dupes you mean duplicate copies of the same file? so you have to keep telling it to overwrite or skip? If you are consistantly choosing the same option (skip or overwrite) there is a setting to have the copy function apply that to all when you copy it.
From the cp man page:
Code:
 -u, --update
copy only when the SOURCE file is  newer than  the  destination file or when the destination file is missing

I haven't seen the skip modifier online, but i do recall being able to do it so i'll keep looking.
 
I am on a Linux environment right now. I like Gnome over the KDE WM based Knoppix. :D Knoppix is some good stuff. I just have to be mindful to avoid Phrozen Bubble while on it. The system is up and going well. I am just rebuilding alot of data back into place.

I used to just filter data by date and drag to disc. It makes for a crazy jumble. But easy(faster anmd cheaper for discs) to do any hard copy backups. Normally I don't have many EBKAC moments with my storage. First time I had to pull this much off hard storage.

I thought also moving folders in that odd fashion might be a bust and more work. I could make a shell script and send to through the right click. Then sort once it is there in the final location.

I do like the option of skipping. Since I would want to manually double check to see what the file is first.

And yes. I do mean duplicates when I mention dupes. Since I am pulling off discs I created almost 10 years ago, to just a week or so ago. I just do not know what is on the discs until start moving it to the hard drive. I have files with similar or same names. I didn't think of adding a date code in a file name long ago. Plus I am into a litle over a year of full time no Windows use. (though I did try and go back to Windows a couple of weeks ago)
. I had a great chuckle seeing the old Mozilla Firebird saves. I am even coming across files that are from 1995(copied from floppy to cd-r years ago). So some of it I have to be mindful of how I work with it.

It is just a mixed jumble and I want to help streamline what I can. Pulling 290 gigs off disc takes long enough. So glad I had hard copies of the data. Though it is a pain. I am just looking for way to streamline getting it in place. Once it is on the hard drive.. It would be nice to do it via ssh also on the other machine if i happen to be sitting over there. Since I am bouncing back and forth loading discs. I figured why not, since I am sitting at a computer. Instead of sneaker netting back and forth to change stuff around.. The other computer has a better setup for disc to disk. So even if I don't find a crafty way of piping some crazy piped dd command. I still can do it slow and steady. It would be nice to shave off an hour or so of walking between computers.
 
Last edited:
well here is how I would deal with moving folders with different file types it wouldnt be one easy step but it would certainly cut down on your manual work


Code:
for x in *.mp3; do echo mv ${x} /my_new_folder; done
this will search everything and extra your mp3s to your new folder. Remove the echo when you are sure the command is doing what you want.

If you wanted to get really complicated just keep throwing out variables

ex:
Code:
for x in *.mp3; do echo mv ${x} /my_new_folder; done; for y in *.jpeg; do echo mv ${y} /my_pictures; done
 
Back