Re: [expert] script help

2003-06-30 Thread michael
Yeah, that might be a good idea :-)  Well, I'm doing great; I answer my
email about once a week!
Well, I've thought about that occasionally - restoring that is.  I guess
I'd have to just reload the system and then copy the target files back to
their original places.

I'll have to play with that on a test box...

> [EMAIL PROTECTED] wrote:
>> Hey thanks Mark!  Sorry to take so long responding; I forgot to renew my
>> domain name and wasn't getting any mail - please don't ask :}
>> thanks again!  mike
>
> No problem Mike. Glad I could help. I have yet to need to restore from
> any of the backups I've been making with it, ( thank God ), but I guess
> I should start working out just how to do that just in case.
>
> --
> Mark
>
> "If necessity is the mother of invention, then who's the father?"
> ---
> Paid for by Penguins against modern appliances(R)
> Linux User Since 1996
> Powered by Mandrake Linux 8.2 & 9.1
> ICQ# 27816299
>
>
> Want to buy your Pack or Services from MandrakeSoft?
> Go to http://www.mandrakestore.com
>


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [expert] script help

2003-06-22 Thread Mark Weaver
[EMAIL PROTECTED] wrote:
Hey thanks Mark!  Sorry to take so long responding; I forgot to renew my
domain name and wasn't getting any mail - please don't ask :}
thanks again!  mike
No problem Mike. Glad I could help. I have yet to need to restore from 
any of the backups I've been making with it, ( thank God ), but I guess 
I should start working out just how to do that just in case.

--
Mark
"If necessity is the mother of invention, then who's the father?"
---
Paid for by Penguins against modern appliances(R)
Linux User Since 1996
Powered by Mandrake Linux 8.2 & 9.1
ICQ# 27816299

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [expert] script help

2003-06-19 Thread michael
> On Wed, 2003-06-18 at 09:32, [EMAIL PROTECTED] wrote:
>> Hey thanks Mark!  Sorry to take so long responding; I forgot to renew my
>> domain name and wasn't getting any mail - please don't ask :}
>> thanks again!  mike
>
> Mike
>
>You blew it ... you could have blamed it on the problems with sympa
> and he would have believed you *grin*
>
> James
>

hehe :))


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [expert] script help

2003-06-18 Thread James Sparenberg
On Wed, 2003-06-18 at 09:32, [EMAIL PROTECTED] wrote:
> Hey thanks Mark!  Sorry to take so long responding; I forgot to renew my
> domain name and wasn't getting any mail - please don't ask :}
> thanks again!  mike

Mike 

   You blew it ... you could have blamed it on the problems with sympa
and he would have believed you *grin*

James

> 
> > Michael Holt wrote:
> >> Hey,
> >> I'm looking for some help on my little backup script for my server.  I'm
> >> not a real savvy scripter so please bare with me :)
> >> I googled around awhile back and put together a bu script that has
> >> served
> >> my purpose well until now.  It's just a few lines as you will see and I
> >> use it with cron to make a cdrw every morning at 3am.
> >>
> >> Now the info on my server is starting to outgrow just on cdrw (jpgs and
> >> such) so I would like to know how I can modify my script to be able to
> >> exclude either certain files or directories.  I imagine that sed would
> >> be
> >> involved, but I don't completely understand that tool so I'm hoping that
> >> someone might be able to give me some pointers and maybe even explain
> >> how
> >> the code will work in that setting.  Well, here's what I've got now:
> >
> > Michael,
> >
> > attached you'll find the one i've been using and it works flawlessly. I
> > can't remember his name, but it was a gentleman here on the expert list
> > that sent me a copy of his and I used his as a guide to cook this one up.
> >
> > enjoy...
> >
> > --
> > Mark
> > ---
> > Paid for by Penguins against modern appliances(R)
> > Linux User Since 1996
> > Powered by Mandrake Linux 8.2 & 9.1
> > ICQ# 27816299
> > #!/bin/sh
> > #MAILTO:mdw1982
> > # ##
> > # variables for the program:
> > # ##
> > TAPE=/dev/st0;
> > HOME_FILES=/home;
> > DOCUMENTS=/mnt/arc_2/Documents;
> > WWW=/var/www;
> > MAIL=/var/spool/mail;
> > DATABASE=/var/lib/mysql;
> > MP3=/mnt/mp3;
> > LOG_PATH=/home/mdw1982/;
> > LOG_DIR=backup_log;
> > DATE=$( date +%m-%d-%Y );
> >
> > # ##
> > # functions for program:
> > # ##
> > message(){
> > echo ".This is the Tape backup program..";
> > echo " ---  ";
> > echo "";
> > echo "I've successfully completed the nightly backup of the system";
> > echo "for $DATE";
> > echo "";
> > echo "The Log file containing the backup's contents has been written";
> > echo "to $LOG_PATH.";
> > echo ". END OF TRANSMISSION ";
> > }
> >
> > # does the directory to receive the backup logs exist?
> > # if not then we're going to create it...
> > checkLog(){
> > for i in $( ls -d /home/mdw1982/* ); do
> > ITEM=$i
> > if [ $ITEM = $LOG_DIR ]
> > then
> > FOUND=true
> > else
> > FOUND=false
> > fi
> > done
> > }
> >
> > # ##
> > # main program :
> > # ##
> >
> > # putting all the goodies to the tape
> > find /bin /boot /etc /home /root /var /mnt/arc_2/Documents /var/www -print
> > | grep -iv "\./var/ftp" | sort | cpio -oaBc -O /dev/tape
> >
> > # writing out the logfile to disk
> > cpio -iBct -I /dev/tape > /home/mdw1982/backup_log/$( date +%m-%d-%Y
> > )_bkup.indx
> >
> >
> > # compressing the logfile
> > gzip -1 /home/mdw1982/backup_log/$( date +%m-%d-%Y )_bkup.indx
> >
> > # outputing message to email
> > message;
> >
> > # exiting the program
> > exit;
> >
> > Want to buy your Pack or Services from MandrakeSoft?
> > Go to http://www.mandrakestore.com
> >
> 
> 
> 
> __
> 
> Want to buy your Pack or Services from MandrakeSoft? 
> Go to http://www.mandrakestore.com


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [expert] script help

2003-06-18 Thread michael
Hey thanks Mark!  Sorry to take so long responding; I forgot to renew my
domain name and wasn't getting any mail - please don't ask :}
thanks again!  mike

> Michael Holt wrote:
>> Hey,
>> I'm looking for some help on my little backup script for my server.  I'm
>> not a real savvy scripter so please bare with me :)
>> I googled around awhile back and put together a bu script that has
>> served
>> my purpose well until now.  It's just a few lines as you will see and I
>> use it with cron to make a cdrw every morning at 3am.
>>
>> Now the info on my server is starting to outgrow just on cdrw (jpgs and
>> such) so I would like to know how I can modify my script to be able to
>> exclude either certain files or directories.  I imagine that sed would
>> be
>> involved, but I don't completely understand that tool so I'm hoping that
>> someone might be able to give me some pointers and maybe even explain
>> how
>> the code will work in that setting.  Well, here's what I've got now:
>
> Michael,
>
> attached you'll find the one i've been using and it works flawlessly. I
> can't remember his name, but it was a gentleman here on the expert list
> that sent me a copy of his and I used his as a guide to cook this one up.
>
> enjoy...
>
> --
> Mark
> ---
> Paid for by Penguins against modern appliances(R)
> Linux User Since 1996
> Powered by Mandrake Linux 8.2 & 9.1
> ICQ# 27816299
> #!/bin/sh
> #MAILTO:mdw1982
> # ##
> # variables for the program:
> # ##
> TAPE=/dev/st0;
> HOME_FILES=/home;
> DOCUMENTS=/mnt/arc_2/Documents;
> WWW=/var/www;
> MAIL=/var/spool/mail;
> DATABASE=/var/lib/mysql;
> MP3=/mnt/mp3;
> LOG_PATH=/home/mdw1982/;
> LOG_DIR=backup_log;
> DATE=$( date +%m-%d-%Y );
>
> # ##
> # functions for program:
> # ##
> message(){
>   echo ".This is the Tape backup program..";
>   echo " ---  ";
>   echo "";
>   echo "I've successfully completed the nightly backup of the system";
>   echo "for $DATE";
>   echo "";
>   echo "The Log file containing the backup's contents has been written";
>   echo "to $LOG_PATH.";
>   echo ". END OF TRANSMISSION ";
> }
>
> # does the directory to receive the backup logs exist?
> # if not then we're going to create it...
> checkLog(){
>   for i in $( ls -d /home/mdw1982/* ); do
>   ITEM=$i
>   if [ $ITEM = $LOG_DIR ]
>   then
>   FOUND=true
>   else
>   FOUND=false
>   fi
>   done
> }
>
> # ##
> # main program   :
> # ##
>
> # putting all the goodies to the tape
> find /bin /boot /etc /home /root /var /mnt/arc_2/Documents /var/www -print
> | grep -iv "\./var/ftp" | sort | cpio -oaBc -O /dev/tape
>
> # writing out the logfile to disk
> cpio -iBct -I /dev/tape > /home/mdw1982/backup_log/$( date +%m-%d-%Y
> )_bkup.indx
>
>
> # compressing the logfile
> gzip -1 /home/mdw1982/backup_log/$( date +%m-%d-%Y )_bkup.indx
>
> # outputing message to email
> message;
>
> # exiting the program
> exit;
>
> Want to buy your Pack or Services from MandrakeSoft?
> Go to http://www.mandrakestore.com
>


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [expert] script help

2003-06-13 Thread Mark Weaver
Michael Holt wrote:
Hey,
I'm looking for some help on my little backup script for my server.  I'm
not a real savvy scripter so please bare with me :)
I googled around awhile back and put together a bu script that has served
my purpose well until now.  It's just a few lines as you will see and I
use it with cron to make a cdrw every morning at 3am.
Now the info on my server is starting to outgrow just on cdrw (jpgs and
such) so I would like to know how I can modify my script to be able to
exclude either certain files or directories.  I imagine that sed would be
involved, but I don't completely understand that tool so I'm hoping that
someone might be able to give me some pointers and maybe even explain how
the code will work in that setting.  Well, here's what I've got now:
Michael,

attached you'll find the one i've been using and it works flawlessly. I 
can't remember his name, but it was a gentleman here on the expert list 
that sent me a copy of his and I used his as a guide to cook this one up.

enjoy...

--
Mark
---
Paid for by Penguins against modern appliances(R)
Linux User Since 1996
Powered by Mandrake Linux 8.2 & 9.1
ICQ# 27816299
#!/bin/sh
#MAILTO:mdw1982
# ##
# variables for the program:
# ##
TAPE=/dev/st0;
HOME_FILES=/home;
DOCUMENTS=/mnt/arc_2/Documents;
WWW=/var/www;
MAIL=/var/spool/mail;
DATABASE=/var/lib/mysql;
MP3=/mnt/mp3;
LOG_PATH=/home/mdw1982/;
LOG_DIR=backup_log;
DATE=$( date +%m-%d-%Y );

# ##
# functions for program:
# ##
message(){
echo ".This is the Tape backup program..";
echo " ---  ";
echo "";
echo "I've successfully completed the nightly backup of the system";
echo "for $DATE";
echo "";
echo "The Log file containing the backup's contents has been written";
echo "to $LOG_PATH.";
echo ". END OF TRANSMISSION ";
}

# does the directory to receive the backup logs exist?
# if not then we're going to create it...
checkLog(){
for i in $( ls -d /home/mdw1982/* ); do
ITEM=$i
if [ $ITEM = $LOG_DIR ]
then
FOUND=true
else
FOUND=false
fi
done
}

# ##
# main program :
# ##

# putting all the goodies to the tape
find /bin /boot /etc /home /root /var /mnt/arc_2/Documents /var/www -print | grep -iv 
"\./var/ftp" | sort | cpio -oaBc -O /dev/tape

# writing out the logfile to disk
cpio -iBct -I /dev/tape > /home/mdw1982/backup_log/$( date +%m-%d-%Y )_bkup.indx


# compressing the logfile
gzip -1 /home/mdw1982/backup_log/$( date +%m-%d-%Y )_bkup.indx

# outputing message to email
message;

# exiting the program
exit;

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [expert] script help

2003-06-11 Thread michael
Thanks Jack and Michael for the pointers!  Sorry to take so long to get
back.  I've used the --exclude option as Michael suggested for now.  Also
thanks for pointing out the -z option for tar; believe it or not I thought
I was actually using that already, I guess my biggest problem is not
paying attention :)

I'm also going to take a look at cdbkup.  I'm not so much trying to
reinvent the wheel really, as I am trying to get more familiar with
scripting.  As I already mentioned, I really glazed over two really
obvious options that were available to me (doh!)  I also like the
simplicity of being able to use stuff that's already on my system.

Thanks again!  Mike

> why reinvent the wheel? Go to freshmeat.net and type cd backup into the
> search. cdbkup is the one I picked, it seems to work. I only use it for
> my MP3 repository though, everything else is just rsynced to multiple
> systems.
>
> On Sun, 2003-06-08 at 21:51, Michael Holt wrote:
>> Hey,
>> I'm looking for some help on my little backup script for my server.  I'm
>> not a real savvy scripter so please bare with me :)
>> I googled around awhile back and put together a bu script that has
>> served
>> my purpose well until now.  It's just a few lines as you will see and I
>> use it with cron to make a cdrw every morning at 3am.
>>
>> Now the info on my server is starting to outgrow just on cdrw (jpgs and
>> such) so I would like to know how I can modify my script to be able to
>> exclude either certain files or directories.  I imagine that sed would
>> be
>> involved, but I don't completely understand that tool so I'm hoping that
>> someone might be able to give me some pointers and maybe even explain
>> how
>> the code will work in that setting.  Well, here's what I've got now:
>>
>>
>> #!/bin/bash
>> #
>> # create daily backup of essential files
>> #
>> DATA="/var"
>> CONFIG="/etc"
>> #
>> set $(date)
>> #
>> # daily full backup:
>> #
>> tar -cvf "/mnt/backup/data/df$2$3.tgz" $DATA
>> #
>> tar -cvf "/mnt/backup/config/cf$2$3.tgz" $CONFIG
>> #
>> # make iso image and burn it to disk:
>> mkisofs -o /tmp/backup.iso /mnt/backup/*
>> #
>> cdrecord -v blank=fast dev=0,2,0 speed=2 -eject /tmp/backup.iso
>> rm -f /tmp/backup.iso
>> rm -f /mnt/backup/data/*
>> rm -f /mnt/backup/config/*
>>
>>
>> In this setting, I can just add all the directories that I want to back
>> up, but it would be much simpler to add just the parent directories and
>> then exclude *.jpg for example or maybe a whole child directory.
>>
>> Thanks a bunch for any help!  Mike

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [expert] script help

2003-06-08 Thread Michael Noble
The man page for tar will give you several options that are available,
one option is --exclude.

You also might want to look at: --compress and --gzip to compress
the data as it is being tared.

Mike

On Sun, 2003-06-08 at 21:51, Michael Holt wrote:
> Hey,
> I'm looking for some help on my little backup script for my server.  I'm
> not a real savvy scripter so please bare with me :)
> I googled around awhile back and put together a bu script that has served
> my purpose well until now.  It's just a few lines as you will see and I
> use it with cron to make a cdrw every morning at 3am.
> 
> Now the info on my server is starting to outgrow just on cdrw (jpgs and
> such) so I would like to know how I can modify my script to be able to
> exclude either certain files or directories.  I imagine that sed would be
> involved, but I don't completely understand that tool so I'm hoping that
> someone might be able to give me some pointers and maybe even explain how
> the code will work in that setting.  Well, here's what I've got now:
> 
> 
> #!/bin/bash
> #
> # create daily backup of essential files
> #
> DATA="/var"
> CONFIG="/etc"
> #
> set $(date)
> #
> # daily full backup:
> #
> tar -cvf "/mnt/backup/data/df$2$3.tgz" $DATA
> #
> tar -cvf "/mnt/backup/config/cf$2$3.tgz" $CONFIG
> #
> # make iso image and burn it to disk:
> mkisofs -o /tmp/backup.iso /mnt/backup/*
> #
> cdrecord -v blank=fast dev=0,2,0 speed=2 -eject /tmp/backup.iso
> rm -f /tmp/backup.iso
> rm -f /mnt/backup/data/*
> rm -f /mnt/backup/config/*
> 
> 
> In this setting, I can just add all the directories that I want to back
> up, but it would be much simpler to add just the parent directories and
> then exclude *.jpg for example or maybe a whole child directory.
> 
> Thanks a bunch for any help!  Mike
> 
> 
> --
> Michael Holt
> Snohomish, WA  (o_
> [EMAIL PROTECTED](o_  (o_  //\
> www.holt-tech.net(/)_ (/)_ V_/_www.mandrake.com
> <
> 
> 
> 
> 
> 

> Want to buy your Pack or Services from MandrakeSoft? 
> Go to http://www.mandrakestore.com
-- 
Michael Noble
mailto: [EMAIL PROTECTED]


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [expert] script help

2003-06-08 Thread Jack Coates
why reinvent the wheel? Go to freshmeat.net and type cd backup into the
search. cdbkup is the one I picked, it seems to work. I only use it for
my MP3 repository though, everything else is just rsynced to multiple
systems.

On Sun, 2003-06-08 at 21:51, Michael Holt wrote:
> Hey,
> I'm looking for some help on my little backup script for my server.  I'm
> not a real savvy scripter so please bare with me :)
> I googled around awhile back and put together a bu script that has served
> my purpose well until now.  It's just a few lines as you will see and I
> use it with cron to make a cdrw every morning at 3am.
> 
> Now the info on my server is starting to outgrow just on cdrw (jpgs and
> such) so I would like to know how I can modify my script to be able to
> exclude either certain files or directories.  I imagine that sed would be
> involved, but I don't completely understand that tool so I'm hoping that
> someone might be able to give me some pointers and maybe even explain how
> the code will work in that setting.  Well, here's what I've got now:
> 
> 
> #!/bin/bash
> #
> # create daily backup of essential files
> #
> DATA="/var"
> CONFIG="/etc"
> #
> set $(date)
> #
> # daily full backup:
> #
> tar -cvf "/mnt/backup/data/df$2$3.tgz" $DATA
> #
> tar -cvf "/mnt/backup/config/cf$2$3.tgz" $CONFIG
> #
> # make iso image and burn it to disk:
> mkisofs -o /tmp/backup.iso /mnt/backup/*
> #
> cdrecord -v blank=fast dev=0,2,0 speed=2 -eject /tmp/backup.iso
> rm -f /tmp/backup.iso
> rm -f /mnt/backup/data/*
> rm -f /mnt/backup/config/*
> 
> 
> In this setting, I can just add all the directories that I want to back
> up, but it would be much simpler to add just the parent directories and
> then exclude *.jpg for example or maybe a whole child directory.
> 
> Thanks a bunch for any help!  Mike
> 
> 
> --
> Michael Holt
> Snohomish, WA  (o_
> [EMAIL PROTECTED](o_  (o_  //\
> www.holt-tech.net(/)_ (/)_ V_/_www.mandrake.com
> <
> 
> 
> 
> 
> __
> 
> Want to buy your Pack or Services from MandrakeSoft? 
> Go to http://www.mandrakestore.com
-- 
Jack Coates
Monkeynoodle: A Scientific Venture...
http://www.monkeynoodle.org/resume.html


Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


[expert] script help

2003-06-08 Thread Michael Holt
Hey,
I'm looking for some help on my little backup script for my server.  I'm
not a real savvy scripter so please bare with me :)
I googled around awhile back and put together a bu script that has served
my purpose well until now.  It's just a few lines as you will see and I
use it with cron to make a cdrw every morning at 3am.

Now the info on my server is starting to outgrow just on cdrw (jpgs and
such) so I would like to know how I can modify my script to be able to
exclude either certain files or directories.  I imagine that sed would be
involved, but I don't completely understand that tool so I'm hoping that
someone might be able to give me some pointers and maybe even explain how
the code will work in that setting.  Well, here's what I've got now:


#!/bin/bash
#
# create daily backup of essential files
#
DATA="/var"
CONFIG="/etc"
#
set $(date)
#
# daily full backup:
#
tar -cvf "/mnt/backup/data/df$2$3.tgz" $DATA
#
tar -cvf "/mnt/backup/config/cf$2$3.tgz" $CONFIG
#
# make iso image and burn it to disk:
mkisofs -o /tmp/backup.iso /mnt/backup/*
#
cdrecord -v blank=fast dev=0,2,0 speed=2 -eject /tmp/backup.iso
rm -f /tmp/backup.iso
rm -f /mnt/backup/data/*
rm -f /mnt/backup/config/*


In this setting, I can just add all the directories that I want to back
up, but it would be much simpler to add just the parent directories and
then exclude *.jpg for example or maybe a whole child directory.

Thanks a bunch for any help!  Mike


--
Michael Holt
Snohomish, WA  (o_
[EMAIL PROTECTED](o_  (o_  //\
www.holt-tech.net(/)_ (/)_ V_/_www.mandrake.com
<



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [expert] Script help needed

2003-06-02 Thread Anne Wilson
On Monday 02 Jun 2003 7:29 am, Ray Warren wrote:
> On Sun, Jun 01, 2003 at 08:29:26PM +0100, Anne Wilson wrote:
> > I want to set up an additional task in the daily cron.  The
> > script I wrote is
> >
> > mv -fu /Data/Backup/GnomeCard.vcf /Data/Backup/GnomeCard.vcf.bak
>
> after this step /Data/Backup/GnomeCard.vcf no longer exists if it
> has been modified more recently than .bak
>
> > cp -fpu /home/anne/GnomeCard.vcf /Data/Backup/GnomeCard.vcf
>
> If step one was true then the copy will be made as the target file
> does not exist
>
> > By my understanding the -u flag says 'only if it is a later
> > version'.
>
> for later version substitute more recent modification date.
>
> It looks like the flow for this script is:
> working file = /home/anne/
> backup = /Data/Backup
> archive = .bak
>
> 1: change working file
> 2A: script runs: backup and archive have the same modification date
> no change
> 2B: working file is modified more recently than backup so copy
> working file to backup 3A: next time script runs: backup has been
> modified more recently than archive so move backup to archive
> 3B: since backup no longer exists the working file is again more
> recent so copy working file to backup even if working file has not
> changed.
>
> So once all of the files exist, the script has to run twice for
> each change before copies are no longer made.
>
> Ray Warren

Thanks for replying, Ray.  Actually, someone asked me a question 
off-list.  Since I had to spell out the logic for him, it dawned on 
my what was happening.  I left the script alone to see what would 
happen, and it ran overnight as intended.  I have a backup of last 
evening's changes, with an archive copy of earlier in the day, when 
the script first was run.

It has been suggested that rsync would be more efficient, so I will 
probably make changes, but I'm happy now that I can achieve the 
intended.  I feel much safer.

Anne

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [expert] Script help needed

2003-06-02 Thread Ray Warren
On Sun, Jun 01, 2003 at 08:29:26PM +0100, Anne Wilson wrote:

> I want to set up an additional task in the daily cron.  The script I 
> wrote is
> 
> mv -fu /Data/Backup/GnomeCard.vcf /Data/Backup/GnomeCard.vcf.bak
after this step /Data/Backup/GnomeCard.vcf no longer exists if it has
been modified more recently than .bak
> cp -fpu /home/anne/GnomeCard.vcf /Data/Backup/GnomeCard.vcf
If step one was true then the copy will be made as the target file does
not exist
> 
> By my understanding the -u flag says 'only if it is a later version'.  
for later version substitute more recent modification date.

It looks like the flow for this script is:
working file = /home/anne/
backup = /Data/Backup
archive = .bak

1: change working file 
2A: script runs: backup and archive have the same modification date no
change
2B: working file is modified more recently than backup so copy working file to backup
3A: next time script runs: backup has been modified more recently than
archive so move backup to archive
3B: since backup no longer exists the working file is again more recent so copy working
file to backup even if working file has not changed.

So once all of the files exist, the script has to run twice for each
change before copies are no longer made.

Ray Warren



Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [expert] Script help needed

2003-06-02 Thread Steven Broos




So if I completely understand it, there is no .bak file in the beginning ?
mv and cp don't see this file, so they assume the sourcefile is newer than the not-existing destination file.

Steven


On Sun, 2003-06-01 at 21:56, Anne Wilson wrote:

On Sunday 01 Jun 2003 8:44 pm, you wrote:
> (I'm mailing directly to you because I'm afraid I'm asking a stupid
> question now :-) )
>
> how do you know it's copied or moved if they are both identical ?
>
I made one copy of each file to the backup file.  After I had run the 
script I had a *.bak file for each and a corrrectly named one.  There 
is, of course, no way I can prove that the correctly named one is 
new.

Anne







[expert] Script help needed

2003-06-02 Thread Anne Wilson
I want to set up an additional task in the daily cron.  The script I 
wrote is

mv -fu /Data/Backup/GnomeCard.vcf /Data/Backup/GnomeCard.vcf.bak
cp -fpu /home/anne/GnomeCard.vcf /Data/Backup/GnomeCard.vcf
mv -fu /Data/Backup/Anne.ics /Data/Backup/Anne.ics.bak
cp -fpu /home/anne/KOrganizer/Anne.ics /Data/Backup/Anne.ics

By my understanding the -u flag says 'only if it is a later version'.  
I have run the script, but copies are made even though they are 
identical.  What have I got wrong?

Anne

Want to buy your Pack or Services from MandrakeSoft? 
Go to http://www.mandrakestore.com


Re: [expert] script help ...

2001-07-05 Thread Laura Conrad

> "Craig" == Craig Sprout <[EMAIL PROTECTED]> writes:

Craig> At 12:35 AM 7/5/2001 -0700, faisal gillani wrote:
>> i am stuck in how can i give the answers to the
>> command automatically ... is
>> it possible ?

Craig> As long as the answer is 'y', there is a command called
Craig> 'yes' that will output nothing put y's.  You can pipe that
Craig> output to fsck (which, I assume is the program to which you
Craig> want to answer yes.).

It's even easier than that; there's a -y option to fsck that answers
everything "yes".  Which I always use; it's not as if I ever know
that I want an different answer.

-- 
Laura (mailto:[EMAIL PROTECTED] , http://www.laymusic.org/ )
(617) 661-8097  fax: (801) 365-6574 
233 Broadway, Cambridge, MA 02139




Re: [expert] script help ...

2001-07-05 Thread Woody Green

 From the fsck man page:

Currently, standardized file system-specific options are somewhat in flux.
Although not guaranteed, the following options are supported by most file
system checkers:

-a Automatically repair the file system without any questions (use
   this option with caution).  Note that e2fsck(8) supports -a for
   backwards compat­ibility only.  This option is mapped to e2fsck's
   -p option which is safe to use, unlike the -a option that most
   file system checkers support.

_END_

  Woody


faisal gillani wrote:

> hello there
> 
>  can any one help me in making a small script all i
> want is that my system
> runs itself in single user mode , then run fsck on / ,
> then return to normal
> mode...
> 
> i know the commands
> 
> 1,  init 1
> 2,  fsck /
> 3,  init 6
> 
> i am stuck in how can i give the answers to the
> command automatically ... is
> it possible ?
> 
> thanks
> Faisal
> 



-- 

---
Gatewood Green Web Developer
http://www.linux.org/  The first stop for Linux info on the Net
Email: [EMAIL PROTECTED]
---
All opinions expressed by me are my own and not necessarily
endorsed by Linux Online, Inc. or Linux Headquarters, Inc.






Re: [expert] script help ...

2001-07-05 Thread Nathan Callahan

HI,

If you want the same answer to all questions for a particular command, 
there is an amazing little utility by the name of "yes"

By default it echos an endless stream of y characters.  If you pass it 
anything as an argument, then that is what is echoed endlessly instead.

You can almost certainly find it in /usr/bin/yes.  Just pipe the output 
to the command that you want the responses for.  As has already been 
pointed out, if the answer varies for any given command, you should 
probably use "expect".

On Thursday, July 5, 2001, at 05:35  PM, faisal gillani wrote:

> hello there
>
>  can any one help me in making a small script all i
> want is that my system
> runs itself in single user mode , then run fsck on / ,
> then return to normal
> mode...
>
> i know the commands
>
> 1,  init 1
> 2,  fsck /
> 3,  init 6
>
> i am stuck in how can i give the answers to the
> command automatically ... is
> it possible ?
>
> thanks
> Faisal
>
>
>
> __
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail
> http://personal.mail.yahoo.com/
>




Re: [expert] script help ...

2001-07-05 Thread Craig Sprout

At 12:35 AM 7/5/2001 -0700, faisal gillani wrote:
>i am stuck in how can i give the answers to the
>command automatically ... is
>it possible ?

As long as the answer is 'y', there is a command called 'yes' that will 
output nothing put y's.  You can pipe that output to fsck (which, I assume 
is the program to which you want to answer yes.).

---
Craig Sprout
Network Administrator
Crown Parts and Machine, Inc.
http://www.crownpartsandmachine.com  






Re: [expert] script help ...

2001-07-05 Thread Randy Kramer

faisal gillani wrote:
>  can any one help me in making a small script all i
> want is that my system
> runs itself in single user mode , then run fsck on / ,
> then return to normal
> mode...
> 
> i know the commands
> 
> 1,  init 1
> 2,  fsck /
> 3,  init 6
> 
> i am stuck in how can i give the answers to the
> command automatically ... is
> it possible ?

Yes.  One way would be using "expect" -- I'd tell you more but I've
never actually used it (yet -- I've used things like it in dos).  Look
at man expect, or "expect" or "expect script" on Google.

Sorry I can't be more helpful,
Randy Kramer




[expert] script help ...

2001-07-05 Thread faisal gillani

hello there

 can any one help me in making a small script all i
want is that my system
runs itself in single user mode , then run fsck on / ,
then return to normal
mode...

i know the commands

1,  init 1
2,  fsck /
3,  init 6

i am stuck in how can i give the answers to the
command automatically ... is
it possible ?

thanks
Faisal



__
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/




[expert] script help

1999-07-21 Thread Robert Sheskin

I have a little log analysis perl script that I am trying to run. When starting form a 
terminal it works fine with the following in an executable script;
#! /bin/bash
echo "Mail Stats Log Analysis"
echo ""
su - root -c "DISPLAY=$DISPLAY; export DISPLAY; aterm -bg black -fg yellow -e perl 
/usr/bin/sm.logger"
When I setup a desktop shortcut and run the same thing with terminal window checked I 
a quick screen flash of the window and it is gone. How do I keep it around?

 __
/ ) +--+ ( \
   / /  |  |  \ \
 _( (   | _   Robert Sheskin _ |   ) )_
(((\ \  |/ )[EMAIL PROTECTED]( \|  / /)))
( \_/ /ICQ:5788323   \ \_/ )
 \   / AIM:RobertLS   \/
  \_/  \_ /
  /   / +--+ \\
 /   /\\