LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 08-13-2017, 06:40 AM   #1
Haines Brown
LQ Newbie
 
Registered: Nov 2010
Location: Hartford, CT
Distribution: Devuan Jessie
Posts: 27

Rep: Reputation: 0
Change default CUPS-PDF save directory


CUPS-PDF normally creates a directory ~/PDF in which to save the PDFs created. I want to change
the default save directory instead to ~/Downloads/PDF. I'm running Devuan Jessie.

The first problem is that my spool directory is /var/spool/cups-pdf has two subdirectories,
ANONYMOUS and SPOOL rather than a username subdirectory. Which of these is really the cups-pdf
spool directory?

To redirect PDF spool files, I stole a script:

#!/bin/sh
SPOOL_DIR=/var/spool/cups-pdf/
USERS_DIR=/home/haines/Downloads/PDF/

inotifywait -mq --timefmt '%Y%m%d %H%M%S' --format '%T %f' \
-e close_write $SPOOL_DIR \
| while read date time file; do
mv $SPOOL_DIR${file} $USERS_DIR${date}${time}_${file}
done

When run it produces the error:

11: /home/haines/scripts/cups-pdf: inotifywait: not found
 
Old 08-13-2017, 07:08 AM   #2
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,749

Rep: Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928Reputation: 5928
The default output directory is /var/spool/cups-pdf/user. You can change the output directory in the cups-pdf.conf file to ${HOME}/Downloads/PDF without needing to use inotify.

Normally you would need to install the inotify tools package to use inotifywait. Not sure if Devuan is the same.
 
Old 03-20-2024, 08:27 PM   #3
0x6A7232
LQ Newbie
 
Registered: Mar 2024
Distribution: MX Linux primary Manjaro secondary
Posts: 1

Rep: Reputation: 0
I wanted mine accessible from ~/Documents so I did a symlink:

Code:
cd ~/Documents
ln -s ../PDF "PDF Printed"
You could do the same with Downloads:

Code:
cd ~/Downloads
ln -s ../PDF PDF
EDIT: for anyone who is brand-spanking new to Linux or symlinks, a symlink is a symbolic link, or a way to tell the filesystem that you want it to treat a certain location as if it exists in another location as well. There are different kinds of symlinks, the one above is a soft symlink. Windows can do this as well with the mklink command.

What the commands above did:
1) change directory (cd) to the Documents (or Downloads) folder in the home folder(~)(/home/yourusername)
2) create a soft link to the folder PDF in the parent folder of the current folder (../) which is ~/PDF, and name the soft link "PDF Printed" in the first example or "PDF" in the second - keep in mind that paths with spaces must be surrounded by quotation marks "". (./ is the current folder, ../ is the parent, ../../ would be the folder above that, etc).

-Why not just link to the absolute path (~/PDF or /home/username/PDF) instead of the relative path? Well, you are unlikely to move your home folders but let's say you did, or you copied them to an external drive under /myprofilebackup/ or somesuch. A link to ~/PDF will point to the PDF folder in the current user on the currently running system's home folder, and a link to /home/yourprofilename/PDF will not work unless that path exists (if you're on another computer borrowing a login, say), whereas a link to ../PDF will point you where you want to go, so long as you also copied the PDF folder along with the folder that has the link to it.

More info on Linux hard and soft links
More info on NTFS Soft and Hard links and Junctions

Last edited by 0x6A7232; 03-20-2024 at 08:48 PM.
 
  


Reply

Tags
cups, save



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Change default directory for 'open' and 'save' in KWrite? qajaq Linux - Software 9 03-04-2014 08:15 PM
[SOLVED] lp doesn't print file to pdf directory after installing cups-pdf using synaptic mrcj Debian 1 10-09-2013 07:18 PM
How to wget a webpage, and save as PDF (like cups-pdf) ? frenchn00b Programming 3 11-18-2008 03:48 PM
Change default Save page directory on FF 2 suguru Linux - Software 4 06-28-2007 06:45 AM
change default save directory canyon289 Linux - Software 1 10-24-2004 12:16 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 06:22 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration