Eric A. Lucas on Thu, 27 Dec 2001 17:40:17 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] Sending a daily cron job to the local printer


thanous@dca.net said:

You don't say what you want to be printed out so I'll just guess that
you would want a list of the files that you zipped up?

Try this:

echo "NOTE:  BACKUP COMPLETE!" > /tmp/RFN$$  
echo " " >> /tmp/RFN$$
echo " File list: " >> /tmp/RFN$$
# you must insert the command that lists the table of contents 
#  for the zip file at this point.
lpr /tmp/RFN$$
rm /tmp/RFN$$

# NOTES:
#  RFN is Random File Name... $$ is the current process id
#  Be sure to use double ">>" to append to the file
#  I cannot find the "list table of contents" option for "zip"
#  If you cannot find it, pipe the output of your zip command to 
#  a file and append it to the page to be printed (using >>)
#  zip -r -u -v /disc1/tbred.zip /usr/lib/basic >> /tmp/RFN$$
#  this means you'll have to put the first three lines of the 
#  above script before your script.

Good luck

Eric Lucas


> Hi list....
> 
> I posted last week sometime that I needed help writing a backup
file.  Well
> I did that... but I choose to use the zip utilitly and only backup a
few selected
> files and directories.  sooooooooooo I wrote the following script to
accoplish
> this...and I placed a copy of it in the /etc/cron.daily folder (as I
am running
> RH 7.0)
> 
> The script runs fine.
> 
> I just need a print out sent to the printer... but my programming
skills leave
> something to be desired... like EVERYTHING.  
> 
> So here is what the script looks like
> 
> #!/bin/sh
> # This batch file backs up the data from the hard drive
> # Below are the script Variables
> 
> 
> echo 'go';
> umount /disc1;
> mount /dev/hdb1 /disc1;
> zip -r -u -v /disc1/tbred.zip /usr/lib/basic;
> umount /disc1;
> 
> 
> 
> 
> 
> 
> 
> 
> 
> ______________________________________________________________________
> Philadelphia Linux Users Group       -      http://www.phillylinux.org
> Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
> General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug
> 
> 




-- 
Eric A. Lucas
# "Oh, I have slipped the surly bonds of earth 
#  and danced the skies on laughter silvered wings...
#                   -- John Gillespie Magee Jr.


______________________________________________________________________
Philadelphia Linux Users Group       -      http://www.phillylinux.org
Announcements-http://lists.phillylinux.org/mail/listinfo/plug-announce
General Discussion  -  http://lists.phillylinux.org/mail/listinfo/plug