SHARE
TWEET

Untitled

a guest Mar 23rd, 2019 78 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. print_loop() {
  2.     for f in /localserver/orders_folder/*; do
  3.         [ -e "$f" ] || continue
  4.         echo "$f";
  5.         /usr/bin/lpr -P samsung $f;
  6.         rm $f;
  7.     done
  8. }
  9.  
  10. if [ -z "$(ls -A /localserver/orders_folder)" ]; then
  11.    echo "Directory is empty, getting latest files.."
  12.    /usr/bin/rsync -avz --remove-source-files user@remoteserver:/var/www/remote_site/orders_export/* /localserver/orders_folder
  13.    print_loop
  14. else
  15.    echo "Not Empty"
  16.    print_loop
  17. fi
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top