Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- #
- #
- LocalDir=/var/mail
- TempDir=/tmp/mail/backup-`date +%d-%m`
- Archive=mail-`date +%d-%m`.bak.tgz
- Ruser=ftptest
- Rpass=1024
- Rdir=/
- Rserver=127.0.0.1
- # Initial checking and packing
- if [ -e $TempDir ]; then
- echo "$TempDir exists quitting"
- else
- mkdir -p $TempDir
- cp -Ra $LocalDir $TempDir
- fi
- if [ -e $TempDir ]; then
- tar -czvf $Archive $TempDir
- else
- echo "$TempDir not found qutting"
- fi
- # FTP
- ftp -n -i $Rserver <<EOF
- user $Ruser $Rpass
- cd $Rdir
- ls
- EOF
- #!/bin/bash
- #
- #A script which runs as a posthook for tea4cups.
- #It calculates the number of pages of a printing job from a user
- #and creates a log.
- #See declarations for which parameters should be given from the tea4cups posthook.
- #
- #Author: Christian Ã….
- #20100225
- #DECLARATIONS
- #These are given by the posthook_billing in /etc/cups/tea4cups.conf
- declare IP="$1"
- declare JOBID="$2"
- declare PRINTER="$3"
- declare PAGES=`pkpgcounter $4`
- declare USER="$5"
- declare MAC=`ssh orestad@tank ./macfinder.sh $1`
- declare DATE=`date | sed 's/ /-/g'`
- declare PLIST="/billing/prints"
- #If log is removed or rotated a new one will be created here
- #First line will be todays date.
- if [ ! -f $PLIST ]; then
- echo `date` > $PLIST
- chmod 644 $PLIST
- fi
- #Logs the current printing job
- echo "$IP::$MAC::$USER::$PAGES::$JOBID::$PRINTER::$DATE" >> /billing/prints
- exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement