[Chugalug] cp -r any gotcha's of which to be aware?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|

[Chugalug] cp -r any gotcha's of which to be aware?

Unkmar
Situation: partition running out of space.
Action: move files to a partition that has plenty of room to grow.

Known possible gotcha's: symlinks that might hard reference old location.
file and/or ownership/permissions.

I listed all the files that are symlinks. to be certain the file move doesn't break anything. (None exist)

ls -lR | grep "^l"

I plan to use -p as well so that mode,ownership,timestamp don't get me.

I'm moving the mysql folder.  I executed ls -la.  I don't see any hidden files, directories or symlinks.  At this point I doubt I even need -r.

Just checking with the geeks greater than I.

Lucius L. Hilley III - unkmar
PS: I'll reintroduce myself soon. Just a bit busy at the moment and want to do it right when I do.


_______________________________________________
Chugalug mailing list
[hidden email]
http://chugalug.org/cgi-bin/mailman/listinfo/chugalug
Reply | Threaded
Open this post in threaded view
|

Re: [Chugalug] cp -r any gotcha's of which to be aware?

Joseph Simoneau
I tend to just use `cp -av` when I do things like that (all and verbose), and it hasn't bitten me in the butt yet.

On Thu, Jan 8, 2015 at 4:02 PM, Unkmar <[hidden email]> wrote:
Situation: partition running out of space.
Action: move files to a partition that has plenty of room to grow.

Known possible gotcha's: symlinks that might hard reference old location.
file and/or ownership/permissions.

I listed all the files that are symlinks. to be certain the file move doesn't break anything. (None exist)

ls -lR | grep "^l"

I plan to use -p as well so that mode,ownership,timestamp don't get me.

I'm moving the mysql folder.  I executed ls -la.  I don't see any hidden files, directories or symlinks.  At this point I doubt I even need -r.

Just checking with the geeks greater than I.

Lucius L. Hilley III - unkmar
PS: I'll reintroduce myself soon. Just a bit busy at the moment and want to do it right when I do.


_______________________________________________
Chugalug mailing list
[hidden email]
http://chugalug.org/cgi-bin/mailman/listinfo/chugalug



_______________________________________________
Chugalug mailing list
[hidden email]
http://chugalug.org/cgi-bin/mailman/listinfo/chugalug
Reply | Threaded
Open this post in threaded view
|

Re: [Chugalug] cp -r any gotcha's of which to be aware?

Unkmar
In reply to this post by Unkmar
Oops, I was down a directory, I do need the -r

On Thu, Jan 8, 2015 at 4:02 PM, Unkmar <[hidden email]> wrote:
Situation: partition running out of space.
Action: move files to a partition that has plenty of room to grow.

Known possible gotcha's: symlinks that might hard reference old location.
file and/or ownership/permissions.

I listed all the files that are symlinks. to be certain the file move doesn't break anything. (None exist)

ls -lR | grep "^l"

I plan to use -p as well so that mode,ownership,timestamp don't get me.

I'm moving the mysql folder.  I executed ls -la.  I don't see any hidden files, directories or symlinks.  At this point I doubt I even need -r.

Just checking with the geeks greater than I.

Lucius L. Hilley III - unkmar
PS: I'll reintroduce myself soon. Just a bit busy at the moment and want to do it right when I do.



_______________________________________________
Chugalug mailing list
[hidden email]
http://chugalug.org/cgi-bin/mailman/listinfo/chugalug
Reply | Threaded
Open this post in threaded view
|

Re: [Chugalug] cp -r any gotcha's of which to be aware?

Jared Hamilton
In reply to this post by Unkmar
I much prefer rsync for large tasks like that. The -K flag (--keep-dirlinks) will preserve symlinks and the -a flag will preserve permissions.

Not to mention you can also use --dry-run and rsync will run showing you what would happen without making any changes, so it's a good way to iron out any details before committing.
--
Jared Hamilton

On January 8, 2015 4:02:06 PM EST, Unkmar <[hidden email]> wrote:

>Situation: partition running out of space.
>Action: move files to a partition that has plenty of room to grow.
>
>Known possible gotcha's: symlinks that might hard reference old
>location.
>file and/or ownership/permissions.
>
>I listed all the files that are symlinks. to be certain the file move
>doesn't break anything. (None exist)
>
>ls -lR | grep "^l"
>
>I plan to use -p as well so that mode,ownership,timestamp don't get me.
>
>I'm moving the mysql folder.  I executed ls -la.  I don't see any
>hidden
>files, directories or symlinks.  At this point I doubt I even need -r.
>
>Just checking with the geeks greater than I.
>
>Lucius L. Hilley III - unkmar
>PS: I'll reintroduce myself soon. Just a bit busy at the moment and
>want to
>do it right when I do.
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Chugalug mailing list
>[hidden email]
>http://chugalug.org/cgi-bin/mailman/listinfo/chugalug

_______________________________________________
Chugalug mailing list
[hidden email]
http://chugalug.org/cgi-bin/mailman/listinfo/chugalug
Reply | Threaded
Open this post in threaded view
|

Re: [Chugalug] cp -r any gotcha's of which to be aware?

Unkmar
I ended up using cp -av and putting the files under /home
I blame Mike for the /home action. :P

Lucius L. Hilley III - Unkmar
PS: restarted mysql and apache2.  All appears to be functioning within normal parameters.

On Thu, Jan 8, 2015 at 4:06 PM, <[hidden email]> wrote:
I much prefer rsync for large tasks like that. The -K flag (--keep-dirlinks) will preserve symlinks and the -a flag will preserve permissions.

Not to mention you can also use --dry-run and rsync will run showing you what would happen without making any changes, so it's a good way to iron out any details before committing.
--
Jared Hamilton

On January 8, 2015 4:02:06 PM EST, Unkmar <[hidden email]> wrote:
>Situation: partition running out of space.
>Action: move files to a partition that has plenty of room to grow.
>
>Known possible gotcha's: symlinks that might hard reference old
>location.
>file and/or ownership/permissions.
>
>I listed all the files that are symlinks. to be certain the file move
>doesn't break anything. (None exist)
>
>ls -lR | grep "^l"
>
>I plan to use -p as well so that mode,ownership,timestamp don't get me.
>
>I'm moving the mysql folder.  I executed ls -la.  I don't see any
>hidden
>files, directories or symlinks.  At this point I doubt I even need -r.
>
>Just checking with the geeks greater than I.
>
>Lucius L. Hilley III - unkmar
>PS: I'll reintroduce myself soon. Just a bit busy at the moment and
>want to
>do it right when I do.
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Chugalug mailing list
>[hidden email]
>http://chugalug.org/cgi-bin/mailman/listinfo/chugalug

_______________________________________________
Chugalug mailing list
[hidden email]
http://chugalug.org/cgi-bin/mailman/listinfo/chugalug


_______________________________________________
Chugalug mailing list
[hidden email]
http://chugalug.org/cgi-bin/mailman/listinfo/chugalug
Reply | Threaded
Open this post in threaded view
|

Re: [Chugalug] cp -r any gotcha's of which to be aware?

Lynn Dixon
In reply to this post by Jared Hamilton
I second rsync for moving data across partitions and file systems. The -a flag does a great job of keeping your permissions, and I think it also preserves timestamps (not 100% on that). 

On Thu, Jan 8, 2015 at 4:06 PM, <[hidden email]> wrote:
I much prefer rsync for large tasks like that. The -K flag (--keep-dirlinks) will preserve symlinks and the -a flag will preserve permissions.

Not to mention you can also use --dry-run and rsync will run showing you what would happen without making any changes, so it's a good way to iron out any details before committing.
--
Jared Hamilton

On January 8, 2015 4:02:06 PM EST, Unkmar <[hidden email]> wrote:
>Situation: partition running out of space.
>Action: move files to a partition that has plenty of room to grow.
>
>Known possible gotcha's: symlinks that might hard reference old
>location.
>file and/or ownership/permissions.
>
>I listed all the files that are symlinks. to be certain the file move
>doesn't break anything. (None exist)
>
>ls -lR | grep "^l"
>
>I plan to use -p as well so that mode,ownership,timestamp don't get me.
>
>I'm moving the mysql folder.  I executed ls -la.  I don't see any
>hidden
>files, directories or symlinks.  At this point I doubt I even need -r.
>
>Just checking with the geeks greater than I.
>
>Lucius L. Hilley III - unkmar
>PS: I'll reintroduce myself soon. Just a bit busy at the moment and
>want to
>do it right when I do.
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Chugalug mailing list
>[hidden email]
>http://chugalug.org/cgi-bin/mailman/listinfo/chugalug

_______________________________________________
Chugalug mailing list
[hidden email]
http://chugalug.org/cgi-bin/mailman/listinfo/chugalug


_______________________________________________
Chugalug mailing list
[hidden email]
http://chugalug.org/cgi-bin/mailman/listinfo/chugalug
Reply | Threaded
Open this post in threaded view
|

Re: [Chugalug] cp -r any gotcha's of which to be aware?

Unkmar
Lynn, I had been reading man as I was posting.  It does preserve timestamps.  I also pull the trigger rather quickly.  Not my usual kind of move.  However, I know I have backups and have plenty of faith in them.  Pretty much been using them all along. :)

Turns out the directory and file structure of mysql appears to be pretty straight forward. Seems to be pretty easy to get right.

Lucius L. Hilley III - Unkmar

On Thu, Jan 8, 2015 at 4:13 PM, Lynn Dixon <[hidden email]> wrote:
I second rsync for moving data across partitions and file systems. The -a flag does a great job of keeping your permissions, and I think it also preserves timestamps (not 100% on that). 

On Thu, Jan 8, 2015 at 4:06 PM, <[hidden email]> wrote:
I much prefer rsync for large tasks like that. The -K flag (--keep-dirlinks) will preserve symlinks and the -a flag will preserve permissions.

Not to mention you can also use --dry-run and rsync will run showing you what would happen without making any changes, so it's a good way to iron out any details before committing.
--
Jared Hamilton

On January 8, 2015 4:02:06 PM EST, Unkmar <[hidden email]> wrote:
>Situation: partition running out of space.
>Action: move files to a partition that has plenty of room to grow.
>
>Known possible gotcha's: symlinks that might hard reference old
>location.
>file and/or ownership/permissions.
>
>I listed all the files that are symlinks. to be certain the file move
>doesn't break anything. (None exist)
>
>ls -lR | grep "^l"
>
>I plan to use -p as well so that mode,ownership,timestamp don't get me.
>
>I'm moving the mysql folder.  I executed ls -la.  I don't see any
>hidden
>files, directories or symlinks.  At this point I doubt I even need -r.
>
>Just checking with the geeks greater than I.
>
>Lucius L. Hilley III - unkmar
>PS: I'll reintroduce myself soon. Just a bit busy at the moment and
>want to
>do it right when I do.
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Chugalug mailing list
>[hidden email]
>http://chugalug.org/cgi-bin/mailman/listinfo/chugalug

_______________________________________________
Chugalug mailing list
[hidden email]
http://chugalug.org/cgi-bin/mailman/listinfo/chugalug


_______________________________________________
Chugalug mailing list
[hidden email]
http://chugalug.org/cgi-bin/mailman/listinfo/chugalug



_______________________________________________
Chugalug mailing list
[hidden email]
http://chugalug.org/cgi-bin/mailman/listinfo/chugalug
Reply | Threaded
Open this post in threaded view
|

Re: [Chugalug] cp -r any gotcha's of which to be aware?

Unkmar
I should note, I also symlinked the old location to the new one.
Didn't want to risk having to change multiple config files to point to new location.  That and it gives appearance of traditional location for easy finding for the next guy that comes in and goes. Um, those files are usually here. Where are they?  What was the previous guy on?  I need some of that! :P

Lucius L. Hilley - unkmar
Part time comedian - Don't worry, not planning to quit my day job. :D

On Thu, Jan 8, 2015 at 4:19 PM, Unkmar <[hidden email]> wrote:
Lynn, I had been reading man as I was posting.  It does preserve timestamps.  I also pull the trigger rather quickly.  Not my usual kind of move.  However, I know I have backups and have plenty of faith in them.  Pretty much been using them all along. :)

Turns out the directory and file structure of mysql appears to be pretty straight forward. Seems to be pretty easy to get right.

Lucius L. Hilley III - Unkmar

On Thu, Jan 8, 2015 at 4:13 PM, Lynn Dixon <[hidden email]> wrote:
I second rsync for moving data across partitions and file systems. The -a flag does a great job of keeping your permissions, and I think it also preserves timestamps (not 100% on that). 

On Thu, Jan 8, 2015 at 4:06 PM, <[hidden email]> wrote:
I much prefer rsync for large tasks like that. The -K flag (--keep-dirlinks) will preserve symlinks and the -a flag will preserve permissions.

Not to mention you can also use --dry-run and rsync will run showing you what would happen without making any changes, so it's a good way to iron out any details before committing.
--
Jared Hamilton

On January 8, 2015 4:02:06 PM EST, Unkmar <[hidden email]> wrote:
>Situation: partition running out of space.
>Action: move files to a partition that has plenty of room to grow.
>
>Known possible gotcha's: symlinks that might hard reference old
>location.
>file and/or ownership/permissions.
>
>I listed all the files that are symlinks. to be certain the file move
>doesn't break anything. (None exist)
>
>ls -lR | grep "^l"
>
>I plan to use -p as well so that mode,ownership,timestamp don't get me.
>
>I'm moving the mysql folder.  I executed ls -la.  I don't see any
>hidden
>files, directories or symlinks.  At this point I doubt I even need -r.
>
>Just checking with the geeks greater than I.
>
>Lucius L. Hilley III - unkmar
>PS: I'll reintroduce myself soon. Just a bit busy at the moment and
>want to
>do it right when I do.
>
>
>------------------------------------------------------------------------
>
>_______________________________________________
>Chugalug mailing list
>[hidden email]
>http://chugalug.org/cgi-bin/mailman/listinfo/chugalug

_______________________________________________
Chugalug mailing list
[hidden email]
http://chugalug.org/cgi-bin/mailman/listinfo/chugalug


_______________________________________________
Chugalug mailing list
[hidden email]
http://chugalug.org/cgi-bin/mailman/listinfo/chugalug




_______________________________________________
Chugalug mailing list
[hidden email]
http://chugalug.org/cgi-bin/mailman/listinfo/chugalug
Reply | Threaded
Open this post in threaded view
|

Re: [Chugalug] cp -r any gotcha's of which to be aware?

Dr.D
In reply to this post by Lynn Dixon

I have used rsync a lot! and there is nothing better for the job of cloning drives on a Linux server…

scp  is good for just a few (hundred) files..     again from server to server..

Dr.D

 

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Lynn Dixon
Sent: Thursday, January 08, 2015 4:14 PM
To: Chattanooga Unix Gnu Android Linux Users Group
Subject: Re: [Chugalug] cp -r any gotcha's of which to be aware?

 

I second rsync for moving data across partitions and file systems. The -a flag does a great job of keeping your permissions, and I think it also preserves timestamps (not 100% on that). 

 

On Thu, Jan 8, 2015 at 4:06 PM, <[hidden email]> wrote:

I much prefer rsync for large tasks like that. The -K flag (--keep-dirlinks) will preserve symlinks and the -a flag will preserve permissions.

Not to mention you can also use --dry-run and rsync will run showing you what would happen without making any changes, so it's a good way to iron out any details before committing.
--
Jared Hamilton


On January 8, 2015 4:02:06 PM EST, Unkmar <[hidden email]> wrote:


>Situation: partition running out of space.
>Action: move files to a partition that has plenty of room to grow.
>
>Known possible gotcha's: symlinks that might hard reference old
>location.
>file and/or ownership/permissions.
>
>I listed all the files that are symlinks. to be certain the file move
>doesn't break anything. (None exist)
>
>ls -lR | grep "^l"
>
>I plan to use -p as well so that mode,ownership,timestamp don't get me.
>
>I'm moving the mysql folder.  I executed ls -la.  I don't see any
>hidden
>files, directories or symlinks.  At this point I doubt I even need -r.
>
>Just checking with the geeks greater than I.
>
>Lucius L. Hilley III - unkmar
>PS: I'll reintroduce myself soon. Just a bit busy at the moment and
>want to
>do it right when I do.
>
>

>------------------------------------------------------------------------

>
>_______________________________________________
>Chugalug mailing list
>[hidden email]
>http://chugalug.org/cgi-bin/mailman/listinfo/chugalug


_______________________________________________
Chugalug mailing list
[hidden email]
http://chugalug.org/cgi-bin/mailman/listinfo/chugalug

 


_______________________________________________
Chugalug mailing list
[hidden email]
http://chugalug.org/cgi-bin/mailman/listinfo/chugalug