SHARE
TWEET

Untitled

a guest Jun 15th, 2017 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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]
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