In: Computer Science
part 1:
How to setup a print server (CUPS), allow clients to connect , print to pdf.
step 1 : open command prompt with the root admin ( Super user)
step 2: yum install cups // Installing CUPS Service
step 3: # vi /etc/cups/cupsd.conf //Configuring CUPS
step 4: # service cups restart // Restart your CUPS server
step 5: Manage the required CUPS server // https: localhost:631
step 6: Run the setup documents.
part 2: • Create a script that backs up the printed documents every 6 hours
Method 1:
For the script you need to look for these two lpq and lpstat
lpq defines the queued jobs on the default printer which has been set and lpq -l does it more accurately.
lpstat -o is used to print the jobs which are in queue.
Method 2:
Try to create the backup using tar as shown below, which is easy approach
tar -cvpzf /bk_up/filename.tar.gz /data/directory
if the destination is not present , then make the destination where you want to backup store.
# mkdir /bk_up
now create the file using vi editor (prescribed) as shown below
# vi /bk_up.sh
use the below code to set the backup time and necessary conditions
#!/bin/bash TIME=`date +%b-%d-%y` # This Command will read the date. Your_file_name=bk_up-$TIME.tar.gz # The filename including the date. source_of_backup=/xyz/www/html # Source backup folder. destination_of_backup=/bk_up # Destination of backup file. tar -cpzf $source_of_backup/$Your_file_name$destination_of_backup
Hope this will work!!!