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