Advertisement
Guest User

Untitled

a guest
Jun 15th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.38 KB | None | 0 0
  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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement