Advertisement
Guest User

Untitled

a guest
Jun 23rd, 2017
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.91 KB | None | 0 0
  1. sheldor ~ # cat ./backupfv
  2. #!/usr/bin/perl
  3.  
  4. use strict;
  5.  
  6. # Mount the filesystem
  7. print "Mounting filesystem...\n";
  8. `mkdir -p /FileVault`;
  9. if (`mount | grep /FileVault` eq '') { `mount -t ntfs-3g /dev/disk/by-uuid/2C6047056046D4EC /FileVault`; }
  10. print "Filesystem mounted.\n";
  11.  
  12. # Run RSYNC (this is the actual backing up)
  13. print "Running RSYNC, please wait...\n";
  14. `rsync -at --delete /FileVault/ /share/backups/FileVault/`;
  15. print "RSYNC completed.\n";
  16.  
  17. # Unmount the filesystem (make it so we can pull out the drive)
  18. print "Unmounting filesystem...\n";
  19. unless (`mount | grep /FileVault` eq '') { `umount /FileVault`; }
  20. if ( -x "/FileVault/" ) { `rmdir /FileVault/`; }
  21. print "Filesystem unmounted, now safe to remove the drive.\n";
  22.  
  23.  
  24. # Lol, I dunno
  25. 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";
  26. sheldor ~ #
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement