Re: backup script

2004-03-10 Thread Jason Lim
From:
http://tldp.org/LDP/abs/html/textproc.html

try the "cut" command. Sounds like it does just what you want.

-J

- Original Message - 
From: "Alexandros Papadopoulos" <[EMAIL PROTECTED]>
To: 
Sent: Wednesday, 10 March, 2004 5:06 PM
Subject: Re: backup script


> On Wednesday 10 March 2004 09:29, Craig Schneider wrote:
> 
> > Just battling to use awk to extract the last for collumns.
> >
> > -rwxrwxr-x   1 root root  [ 234 Mar 10 06:38 backup ]
> >
> > Any help would be greatly appreciated. Shell scripting is definitely
> > not one of my strong points.
>
> http://tldp.org/guides.html
>
> Look for "Advanced Bash Shell Scripting guide" - it'll cover all you
> need.
>
> Especially for awk, http://sparky.rice.edu/~hartigan/awk.html is also
> interesting.
>
> -A
>
>
> -- 
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact
[EMAIL PROTECTED]
>
>




Re: backup script

2004-03-10 Thread Konstantin Kostadinov
On Wed, 10 Mar 2004 11:06:42 +0200
Alexandros Papadopoulos <[EMAIL PROTECTED]> wrote:

> On Wednesday 10 March 2004 09:29, Craig Schneider wrote:
> 
> > Just battling to use awk to extract the last for collumns.
> >
> > -rwxrwxr-x   1 root root  [ 234 Mar 10 06:38 backup ]
> >
> > Any help would be greatly appreciated. Shell scripting is definitely
> > not one of my strong points.

try this : 

ls -l | awk -F" " '{print $6, $7, $8, $9, $10}' 




-- 

Konstantin Kostadinov

Public PGP : http://www.fadata.bg/pgp/konstantinpgp.asc
---

It may or may not be worthwhile, but it still has to be done.




Re: backup script

2004-03-10 Thread Alexandros Papadopoulos
On Wednesday 10 March 2004 09:29, Craig Schneider wrote:

> Just battling to use awk to extract the last for collumns.
>
> -rwxrwxr-x   1 root root  [ 234 Mar 10 06:38 backup ]
>
> Any help would be greatly appreciated. Shell scripting is definitely
> not one of my strong points.

http://tldp.org/guides.html

Look for "Advanced Bash Shell Scripting guide" - it'll cover all you 
need.

Especially for awk, http://sparky.rice.edu/~hartigan/awk.html is also 
interesting.

-A




backup script

2004-03-10 Thread Craig Schneider
Title: backup script






Hi Guys


I am trying to write a backup script that will backup etc configs, websites and mysql stuff then

email the sizes and time/date info etc.


This is what I have at the moment:


#!/bin/bash


HOST_TITLE="ns.smeesserver.co.uk"


cd /root

tar Icvpf etc.tar.bz2 /etc/*

tar Icvpf websites.tar.bz2 /home/sites/*

tar Icvpf mysql.tar.bz2 /home/mysql/*


ls -l | mail [EMAIL PROTECTED] -s "Backup -- $HOST_TITLE"


exit 0


--


Just battling to use awk to extract the last for collumns.


-rwxrwxr-x   1 root root  [ 234 Mar 10 06:38 backup ]


Any help would be greatly appreciated. Shell scripting is definitely not one of my strong points.


Thanks

Craig





Re: backup script

2004-03-10 Thread Jason Lim
From:
http://tldp.org/LDP/abs/html/textproc.html

try the "cut" command. Sounds like it does just what you want.

-J

- Original Message - 
From: "Alexandros Papadopoulos" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, 10 March, 2004 5:06 PM
Subject: Re: backup script


> On Wednesday 10 March 2004 09:29, Craig Schneider wrote:
> 
> > Just battling to use awk to extract the last for collumns.
> >
> > -rwxrwxr-x   1 root root  [ 234 Mar 10 06:38 backup ]
> >
> > Any help would be greatly appreciated. Shell scripting is definitely
> > not one of my strong points.
>
> http://tldp.org/guides.html
>
> Look for "Advanced Bash Shell Scripting guide" - it'll cover all you
> need.
>
> Especially for awk, http://sparky.rice.edu/~hartigan/awk.html is also
> interesting.
>
> -A
>
>
> -- 
> To UNSUBSCRIBE, email to [EMAIL PROTECTED]
> with a subject of "unsubscribe". Trouble? Contact
[EMAIL PROTECTED]
>
>


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: backup script

2004-03-10 Thread Konstantin Kostadinov
On Wed, 10 Mar 2004 11:06:42 +0200
Alexandros Papadopoulos <[EMAIL PROTECTED]> wrote:

> On Wednesday 10 March 2004 09:29, Craig Schneider wrote:
> 
> > Just battling to use awk to extract the last for collumns.
> >
> > -rwxrwxr-x   1 root root  [ 234 Mar 10 06:38 backup ]
> >
> > Any help would be greatly appreciated. Shell scripting is definitely
> > not one of my strong points.

try this : 

ls -l | awk -F" " '{print $6, $7, $8, $9, $10}' 




-- 

Konstantin Kostadinov

Public PGP : http://www.fadata.bg/pgp/konstantinpgp.asc
---

It may or may not be worthwhile, but it still has to be done.


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



Re: backup script

2004-03-10 Thread Alexandros Papadopoulos
On Wednesday 10 March 2004 09:29, Craig Schneider wrote:

> Just battling to use awk to extract the last for collumns.
>
> -rwxrwxr-x   1 root root  [ 234 Mar 10 06:38 backup ]
>
> Any help would be greatly appreciated. Shell scripting is definitely
> not one of my strong points.

http://tldp.org/guides.html

Look for "Advanced Bash Shell Scripting guide" - it'll cover all you 
need.

Especially for awk, http://sparky.rice.edu/~hartigan/awk.html is also 
interesting.

-A


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]



backup script

2004-03-10 Thread Craig Schneider
Title: backup script






Hi Guys


I am trying to write a backup script that will backup etc configs, websites and mysql stuff then

email the sizes and time/date info etc.


This is what I have at the moment:


#!/bin/bash


HOST_TITLE="ns.smeesserver.co.uk"


cd /root

tar Icvpf etc.tar.bz2 /etc/*

tar Icvpf websites.tar.bz2 /home/sites/*

tar Icvpf mysql.tar.bz2 /home/mysql/*


ls -l | mail [EMAIL PROTECTED] -s "Backup -- $HOST_TITLE"


exit 0


--


Just battling to use awk to extract the last for collumns.


-rwxrwxr-x   1 root root  [ 234 Mar 10 06:38 backup ]


Any help would be greatly appreciated. Shell scripting is definitely not one of my strong points.


Thanks

Craig