[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Sheflug] Scripting backups to cdrom.
Chris,
----- Original Message -----
From: "Chris J" <cej [at] nightwolf.org.uk>
To: <shef-lug [at] list.sheflug.org.uk>
Sent: Wednesday, June 18, 2003 5:09 PM
Subject: Re: [Sheflug] Scripting backups to cdrom.
>
> And Lo! The Great Prophet " Chris J" uttered these words of wisdom:
> >
> > Something like this gives the basis to start from:
> >
> > du -sk * | sort -k2 | mklist.awk
> >
>
> I've done some more fiddling and come up with:
>
> #!/bin/awk -f
> BEGIN {
> LIMIT=680000
>
> CDCOUNT=1
> SIZE=0
> PATHS=""
> }
> {
> if (SIZE + $1 > LIMIT) {
> SIZE = 0
> print "mkisofs -JraT -o CDROM" CDCOUNT ".iso " PATHS
> PATHS = ""
> CDCOUNT++
> }
> SIZE += $1
> PATHS = PATHS " " $2
> }
> ## End of awk
>
Chris, this works, (well I haven`t tried actually running the resulting
output) but, It only outputs a command line once the limit has been reached.
Meaning that if the source files are less that Limit it does not output
anything, If over the last few folders are not output.
My guess is that I need to add an extra print line, which executes once stin
is closed at the end of the directory listing. How do I do that?
Thanks
Rob Keeling
___________________________________________________________________
Sheffield Linux User's Group -
http://www.sheflug.co.uk/mailfaq.html
GNU the choice of a complete generation.