Saving/Copying a directory to USB every 5 minutes

Discussion in 'Mac Basics and Help' started by Bricoducat, Jun 14, 2019 at 6:31 AM.

  1. Bricoducat macrumors newbie

    Joined:
    Friday
    Location:
    Lyon
    #1
    Hello
    Sorry if it's simple, it's y first post.
    This is to bullet proof a Macbook air for an exam.
    Mac will be clean installed with only libreoffice, output will be USB key (another Mac in the bag as backup)
    I am looking to copy the created file to the usb key every 5 minutes as a backup in case of system failure crash/death. So that only action is to unplug USB and stick it into the other Mac out of the bag.

    For the moment I am thinking cp script and crontab

    Any better idea ? someone must have done it before me.
     
  2. Mikael H macrumors 6502a

    Joined:
    Sep 3, 2014
    #2
    Sounds like you really don’t trust your computer.
    If you’re being paranoid, you might as well do it properly: Have the copy script save the file/folder with a date/time based prefix so if your computer dies while writing to the USB you’ve only lost 10 minutes rather than all your work up until that point.
     
  3. NoBoMac macrumors 68020

    Joined:
    Jul 1, 2014
    #3
    Cron would work. A more Apple/Mac sanctioned method are LaunchAgents. There is an example on the following for pretty much what you want re: every five minutes do something.

    https://developer.apple.com/library...stemStartup/Chapters/CreatingLaunchdJobs.html

    Instead of doing a copy, can use the rsync command so that only deltas are copied.

    But as @Mikael H points out, if system dies while writing, might have bigger issues. Also, from my experience, the brand/quality of the thumb drive can add a level of exposure as some are really slow when writing data. Eg. I have some Lexars I bought a few years back, and they are terrible when writing many small files, not as terrible when copying over one or two large files (but still slow).
     
  4. StralyanPithecus macrumors regular

    StralyanPithecus

    Joined:
    Sep 27, 2018
    #4
    or you can use FreeFileSync ( https://freefilesync.org/ ), they have both Mac and Windows versions with realtime sync. I use it in both Windows and MacOS without any issue. Ah and it's free, but you can donate to them if you feel so. (I did).
     
  5. Bricoducat thread starter macrumors newbie

    Joined:
    Friday
    Location:
    Lyon
    #5
    Works once you figured out how to use autosync
    Thanks
     

Share This Page

4 June 14, 2019