SHARE
TWEET

Untitled

a guest Jun 15th, 2017 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #!/bin/sh
  2.  
  3. # Mount the Samba share first
  4. # mount -t cifs //<windows_server>/<path> /mnt/<mnt_dir> -o user=<windows user>,password=<pass>
  5.  
  6. $FILE = "backup_${RANDOM}.tar.gz"
  7. tar zcf /home/script/$FILE /home/files # or /home/files/* if you don't want to keep the parent dir
  8. cp /home/script/$FILE /mnt/windows_mount
  9. find . -name 'backup_*' -mtime +3 -exec rm {} \;
  10.  
  11. # umount /mnt/mnt_dir
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