Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- sheldor ~ # cat ./backupfv
- #!/usr/bin/perl
- use strict;
- # Mount the filesystem
- print "Mounting filesystem...\n";
- `mkdir -p /FileVault`;
- if (`mount | grep /FileVault` eq '') { `mount -t ntfs-3g /dev/disk/by-uuid/2C6047056046D4EC /FileVault`; }
- print "Filesystem mounted.\n";
- # Run RSYNC (this is the actual backing up)
- print "Running RSYNC, please wait...\n";
- `rsync -at --delete /FileVault/ /share/backups/FileVault/`;
- print "RSYNC completed.\n";
- # Unmount the filesystem (make it so we can pull out the drive)
- print "Unmounting filesystem...\n";
- unless (`mount | grep /FileVault` eq '') { `umount /FileVault`; }
- if ( -x "/FileVault/" ) { `rmdir /FileVault/`; }
- print "Filesystem unmounted, now safe to remove the drive.\n";
- # Lol, I dunno
- print "\nThis script was made by Bradley Hammond (aka Alpha) and is intended for use backing up a personal flash drive. All code is free-for-all\n";
- sheldor ~ #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement