Advertisement
Guest User

Untitled

a guest
Jun 15th, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.72 KB | None | 0 0
  1. Open up your mouth baby bird! Here comes the vomit! :P
  2.  
  3. Don't C&P and run this then without making sure it does exactly what you want (I hold no responsibility ;)).
  4. [code]#!/bin/sh
  5.  
  6. # Mount the Samba share first
  7. # mount -t cifs //<windows_server>/<path> /mnt/<mnt_dir> -o user=<windows user>,password=<pass>
  8.  
  9. $FILE = "backup_${RANDOM}.tar.gz"
  10. tar zcf /home/script/$FILE /home/files # or /home/files/* if you don't want to keep the parent dir
  11. cp /home/script/$FILE /mnt/windows_mount
  12. find . -name 'backup_*' -mtime +3 -exec rm {} \;
  13.  
  14. # umount /mnt/mnt_dir
  15. [/code]
  16. This might be horribly broken, but it should get you going in the right direction. This might also help out.
  17. [code]man find
  18. man stat
  19. man mount.cifs[/code]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement