Fantasy Grounds Merchandise
Page 2 of 4 First 1234 Last
  1. #11

    Join Date
    Jun 2013
    Location
    Isanti, MN
    Posts
    2,922
    I have CygWin installed, here is a batch file I use to run FG and backup to a RAID NAS (which is also backed to cloud storage) after each session:

    Code:
    set PATH=C:\cygwin64\bin;%PATH%
    "C:\Program Files (x86)\Fantasy Grounds\FantasyGrounds.exe"
    
    rem do a backup
    bash ~/bin/backup_games
    And my "backup_games" script:

    Code:
    #!/usr/bin/env bash
    # vi:sw=2:ai
    
    indir=/cygdrive/d/Fantasy\ Grounds/
    outdir=linux:/mnt/public/games-backup/
    
    rsync -Ca --delete-after --human-readable \
      --info=BACKUP,COPY,DEL,NAME,STATS \
      "$indir" "$outdir"

  2. #12
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    27,024
    Blog Entries
    1
    Ok.... ok....

    Download this: https://www.7-zip.org/a/7za920.zip
    and place the 7za.exe file in your c:\widows\system32 directory

    Assuming your FG data file is in the (new) default location %AppData%\"fantasy grounds"
    (The previous default location was %ProgramData%\"fantasy grounds")
    And your OneDrive data file is in the default location %userprofile%\OneDrive
    or your DropBox data is in the default location %userprofile%\dropbox

    You can create a batch file like below... my compressed campaigns folder (after cleanup) is still over 200mb so work out what works for you...

    Edit: Ive updated these... the initial error checking had some logic flaws so I removed them. Ive also changed it to backup all the XML files in the campaigns folder every time it runs and then to a separate file it will only add any changed data to the full campaigns backup (eg it will just update the existing zip file with new images/data). This only backups up \campaigns and no other folders.

    This version will be much easier on your upload bandwidth after the first one syncs.

    OneDrive
    Code:
    echo off
    
    
    :BACKUP
    
    :GETTIME
    echo "GETTIME"
    set hh=%time:~0,2%
    if "%time:~0,1%"==" " set hh=0%hh:~1,1%   
    set dt=%date:~7,2%%date:~4,2%%date:~10,4%%hh%
    echo %dt%
    
    :BACKUPTARGET
    echo "BACKUPTARGET"
    echo %userprofile%\OneDrive\
    if not exist %userprofile%\OneDrive\FGData mkdir %userprofile%\OneDrive\FGData
    
    :BACKUPXMLFILES
    echo "BACKUPXMLFILES"
    echo %dt%
    echo %ProgramData%\"fantasy grounds"\campaigns\
    7za.exe a -tzip %userprofile%\OneDrive\FGData\%dt%.zip %AppData%\"fantasy grounds"\campaigns\*.xml -r
    
    :BACKUPCAMPAIGNFILES
    echo "BACKUPCAMPAIGNFILES"
    if not exist %userprofile%\OneDrive\FGData\campaigns.zip 7za.exe a -tzip %userprofile%\OneDrive\FGData\%dt%.zip %AppData%\"fantasy grounds"\campaigns\*.xml -r
    7za.exe u -tzip %userprofile%\OneDrive\FGData\campaigns.zip %AppData%\"fantasy grounds"\campaigns\*.* -r
    
    :LISTFILES
    echo "LISTFILES"
    dir %userprofile%\OneDrive\FGData\
    echo "Always double check that the backups have indeed worked!"
    echo "Happy Gaming"
    pause
    EXIT
    DropBox
    Code:
    echo off
    
    
    :BACKUP
    
    :GETTIME
    echo "GETTIME"
    set hh=%time:~0,2%
    if "%time:~0,1%"==" " set hh=0%hh:~1,1%   
    set dt=%date:~7,2%%date:~4,2%%date:~10,4%%hh%
    echo %dt%
    
    :BACKUPTARGET
    echo "BACKUPTARGET"
    echo %userprofile%\DropBox\
    if not exist %userprofile%\DropBox\FGData mkdir %userprofile%\DropBox\FGData
    
    :BACKUPXMLFILES
    echo "BACKUPXMLFILES"
    echo %dt%
    echo %appdata%\"fantasy grounds"\campaigns\
    7za.exe a -tzip %userprofile%\DropBox\FGData\%dt%.zip %AppData%\"fantasy grounds"\campaigns\*.xml -r
    
    :BACKUPCAMPAIGNFILES
    echo "BACKUPCAMPAIGNFILES"
    if not exist %userprofile%\DropBox\FGData\campaigns.zip 7za.exe a -tzip %userprofile%\DropBox\FGData\%dt%.zip %AppData%\"fantasy grounds"\campaigns\*.xml -r
    7za.exe u -tzip %userprofile%\DropBox\FGData\campaigns.zip %AppData%\"fantasy grounds"\campaigns\*.* -r
    
    :LISTFILES
    echo "LISTFILES"
    dir %userprofile%\DropBox\FGData\
    echo "Always double check that the backups have indeed worked!"
    echo "Happy Gaming"
    pause
    EXIT

  3. #13
    Wanted to thank you guys! I tried this out and it does exactly what I need, except for one thing : I have to remember to think about clicking that batch file. If not, I'll let it slip. If only there was a way I could somehow attach a nag screen when FG closes-- then I'll back up for good luck.
    Ultimate Licence holder

    I've had FG for so LONG I DON'T KNOW HOW TO USE IT!

    But I'm learning!

  4. #14

    Join Date
    Jun 2013
    Location
    Isanti, MN
    Posts
    2,922
    Change the icon for FG to point to the batch file rather than the executable. This way, when you double click the icon, it runs the batch file.

  5. #15
    LordEntrails's Avatar
    Join Date
    May 2015
    Location
    -7 UTC
    Posts
    17,707
    Blog Entries
    9
    You can also setup a scheduled task to run at logoff that runs the backup portion of the batch file. That way, every time you log off your computer, it will run your backup script first. (Though I'm not sure the dropbox or Onedrive backup would be completed before logoff, but then that would happen when you next log in.)

    Problems? See; How to Report Issues, Bugs & Problems
    On Licensing & Distributing Community Content
    Community Contributions: Gemstones, 5E Quick Ref Decal, Adventure Module Creation, Dungeon Trinkets, Balance Disturbed, Dungeon Room Descriptions
    Note, I am not a SmiteWorks employee or representative, I'm just a user like you.

  6. #16
    I created a batch file that runs (using the windows timer) at a time when Fantasy Grounds is never up, it backs up my FG directory to Dropbox.

  7. #17
    damned's Avatar
    Join Date
    Mar 2011
    Location
    Australia
    Posts
    27,024
    Blog Entries
    1
    Edit: Ive updated my post above... the initial error checking had some logic flaws so I removed them. Ive also changed it to backup all the XML files in the campaigns folder every time it runs and then to a separate file it will only add any changed data to the full campaigns backup (eg it will just update the existing zip file with new images/data). This only backups up \campaigns and no other folders.

  8. #18
    *BUMP* Thanks for this @damned and everyone else. Great best practices method, "Thou shall backup!"

  9. #19
    Thanks from me too, Dropbox script works well. Only thing is and this might just be me, but I do not have an %Appdata% Fantasy Grounds folder on my Windows 10 Pro 64 bit laptop so I set it to backup ProgramData\Fantasy Grounds instead. Think this is right

  10. #20

    Join Date
    Jun 2013
    Location
    Isanti, MN
    Posts
    2,922
    Well, that won't backup your campaign data... Check your settings to see where your data is stored.

Page 2 of 4 First 1234 Last

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
GI JOE RPG Launch

Log in

Log in