Incremental Backup Script for NAS server

Discussion in 'Scripting' started by SomeoneTookMyName, Apr 25, 2017.

  1. SomeoneTookMyName

    SomeoneTookMyName MDL Novice

    Oct 17, 2016
    23
    0
    0
    Hey Guys,

    I'm running a work laptop that has a lot of stuff on it that needs to be backed up regularly (250gb). I have a NAS server running on the local network that I would like to back up to on a regular basis.

    My NAS server is running FreeNAS. 99% of the time my laptop will be backing up on the local network and that other 1% of the time I can VPN in.

    My server shares are set up as mapped drives in windows 7.

    So what I would like to do is have an incremental backup. Lets say every day of the week the scripts backs up only files that have changed. At the end of the week those changes can all be consolidated into one folder. At the end of the month only the most recent weekly backup can be kept. I would then have a monthly backup for the whole year. At the end of the year, only the most recent monthly backup needs to be kept. From there I can manually keep or delete things.

    So the issue is that I don't want to have to transfer 250gb over the network every time I back up because, even at 105MB/s it still takes a long time to backup. No matter what the server is going to have to work hard to duplicate all that data so it may be better if, for the most part, the server duplicates the previous week as a basis for the next weeks backups. It could then be done a day in advance.

    I guess the question is, can commands be sent to the server via the windows command prompt to control backup processes at the other end? I don't really want to have 2 separate scripts running that don't communicate.

    Is there a better way to do this or should I just have this script backup everything every month and then just do daily backups of changed files?

    As of right now I have a bunch of xcopy and robocopy scripts that I run manually which is stupid since backups don't get run as much as they should.

    I was also thinking that it might be a good idea to have a cron job on the server that moves the backups to a directory owned and controlled by root to prevent any of these s**tty ransomware assholes from getting in a messing with files since my credentials are already entered for the mapped drive.
     
  2. SomeoneTookMyName

    SomeoneTookMyName MDL Novice

    Oct 17, 2016
    23
    0
    0
    Sorry, just noticed the Scripting forum, this thread should probably be in there. My bad.
     
  3. sebus

    sebus MDL Guru

    Jul 23, 2008
    5,893
    1,780
    180
    Drive Snapshot