Advertisement
geirby

copylast.sh

May 23rd, 2014
353
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.27 KB | None | 0 0
  1. #!/bin/bash
  2. # parse the last one and set filename to var
  3. lastfile=$(ls /root/Backupsrv2/lexis_fssp_out/out/ -tlr | awk '{ print $9 }' | tail -1 | sed -e 's/^/\/root\/Backupsrv2\/lexis_fssp_out\/out\//')
  4. # copy
  5. scp $lastfile root@10.155.10.99:/usr/local/pristav_update/upload
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement