Do you have a favorite unix command? - X Nations
      
      
Go Back   X Nations > X Nations > General Webmaster Business and Discussions

Reply
 
Thread Tools Display Modes
Old 09-11-2005, 06:15 AM   #1
monaro
monaro should edit this Edit
Guest
 
Posts: n/a
xBucks: 0 [Check]
Default Do you have a favorite unix command?

G'day, for myself it would have to be the one that lets you copy one or more files to another location.


cp [OPTION]... --target-directory=DIRECTORY SOURCE...

I use this to backup a full domain.

I get scared when I use the one below though,
on a unixcodes.txt file it reads


************************************************** ****
rm -f *.* make dam sure you know where you are in!!!!
************************************************** ****

I'm just interested in learning more about unix and hence the question above
  Reply With Quote
Old 09-28-2005, 01:21 PM   #2
thruma
thruma is hard at work.(double meaning)
Senior Member
 
thruma's Avatar
 
Join Date: Aug 2004
Location: Canada
Posts: 920
xBucks: 5,225
Default

Hey monaro.
Not sure I have a fav unix command but unix/linux itself is my fave OS.

If you're doing backups have a look at the tar command and the gzip command.

you can put these into a script file and run it like a program.

sort of like a DOS batch file.

Say you have a domain called monaro.com

you could do it like this

tar -cvf monaro.com monaro-backup
cp monaro-backup new-backup-directory

then if you need to restore the backup you can just do this

cp new-backup-directory monaro-backup
tar -xvf monaro-backup

Thats without zipping it if you want to save time zipping it up

you can read the entire options for tar or any other command by typing "man tar" at the unix prompt.

Enjoy
thruma is offline   Reply With Quote
Old 09-28-2005, 03:21 PM   #3
monaro
monaro should edit this Edit
Guest
 
Posts: n/a
xBucks: 0 [Check]
Default

G'day, how have you been?

I see your point in using tar in the backup,
I have been going the the actual directory that I want to backup, typing pwd, then copy the full line location you know and then using
cp -Rpf options like you already know.

I might give it a go with the tar option, so thank you for that.

One other thing Thruma, find and replace, im having fun with gawk, to make things a less painless on my side to update or add various hardlinks on 1000's of indexed pages across many domains.

The more time i can save on one task can give myself time to focus on other tasks and so on.

Always
  Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Forum Jump

Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
2013 - xnations.com
All times are GMT -4. The time now is 11:59 AM.
Skin by vBCore.com