Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/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
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement