I've installed incron and it works with basic event based commands like printing a file.
I want to do two things based on a new file being saved in the watched folder, but am struggling to accomplish this.
# /var/prn IN_CLOSE_WRITE lp -d cups_printer $@/$#
# /var/prn IN_CLOSE_WRITE mv $@/$# /var/prn/printed
# Second command doesn't work, as incron manual already said you can only do one line per folder/file
# /var/prn IN_CLOSE_WRITE lp -d cups_printer $@/$#; mv $@/$# /var/prn/printed;
# Neither command works
How can we do multiple consecutive commands based on one file event?
If it's just plain impossible, I guess I could pass the $@/$# to a bash script. If that's the only way forward, could you write out the bash script for me? I don't have a lot of experience with that.
On a side-note, can we tell incron to ignore hidden files? When I create a file with vim, it attempts to print the .swp files.