RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
[RGSS3] Advanced Backup – Backup Specific Files

0 Members and 1 Guest are viewing this topic.

*
Scripter
Rep:
Level 40
Crownless King
[RGSS3] Advanced Backup – Backup Specific Files
Version: 1.0
Author: Soulpour777
Date: February 16, 2015

Description


This script allows you to backup specific files by using source and destination by FileUtils module. The reason why it is a specific backup is because it can be used to duplicate a file prior to saving and saving.

Features

  • Backup Actors, Classes, Items, Weapons, Armors, Maps, States, Tilesets and Map Information
  • Uses a Ruby Module for more advanced functionalities for scripters

Screenshots



Instructions

To backup all your specific files, do this on a script call:
 
Code: [Select]
backup_listed_files

The backup files are located on the Game Folder, in a folder named "Backup".

Script


Code: [Select]

#==============================================================================
# ** Backup Specific Files
# Author: Soulpour777
# February 16, 2015
#------------------------------------------------------------------------------
# Description: This script allows you to backup specific files by using source
# and destination by FileUtils module. The reason why it is a specific backup
# is because it can be used to duplicate a file prior to saving and saving.
#------------------------------------------------------------------------------
# Requirements: This needs the FileUtils Module written by Minero Aoki.
# You can access this module in this location:
# https://raw.githubusercontent.com/sj26/ruby-1.9.3-p0/master/lib/fileutils.rb
#------------------------------------------------------------------------------
# Instructions:
# To backup all your specific files, do this on a script call:
# backup_listed_files
#------------------------------------------------------------------------------
# The backup files are located on the Game Folder, in a folder named "Backup".
#==============================================================================

module Soul
  module Files_Backup
    # Specified files to backup. Why specify? Because I want to make it
    # a script where you want to backup what you want, not what the script
    # permanently dictates. I want to make it flexible as possible.
    Files = ["Actors.rvdata2", "Animations.rvdata2", "Armors.rvdata2",
    "Classes.rvdata2", "CommonEvents.rvdata2", "Enemies.rvdata2",
    "Items.rvdata2", "Scripts.rvdata2", "Skills.rvdata2",
    "States.rvdata2", "States.rvdata2", "System.rvdata2", "Tilesets.rvdata2",
    "Troops.rvdata2", "Weapons.rvdata2", "MapInfos.rvdata2"]
    Map_Number = ["Map001.rvdata2"] # no maps to backup, add map numbers you want to backup.
    # For example: map_Number = ["Map001.rvdata2"]
  end
end

class Game_Interpreter
  #--------------------------------------------------------------------------
  # * copy_with_path (New Function) - this duplicates the source and puts
  # it into a new destination. You can use this to back up your files right
  # before you save it. So when you have an item existent or non existent
  # prior of that saving, you will still have it.
  #--------------------------------------------------------------------------
  def copy_with_path(src, dst)
    FileUtils.mkdir_p(File.dirname(dst))
    FileUtils.cp(src, dst)
  end
 
  def backup_listed_files
    Soul::Files_Backup::Files.each do |files_to_backup|
      copy_with_path("Data/#{files_to_backup}","Backup/#{files_to_backup}")
    end
    Soul::Files_Backup::Map_Number.each do |maps_to_backup|
      copy_with_path("Data/#{maps_to_backup}","Backup/#{maps_to_backup}")
    end   
  end
end



Credit


  • Soulpour777 for creating the backup script
  • Minero Aoki - for the FileUtils

Support


For support, please contact me here at RMRK, comment below or PM me at my blog's MAILING CONTACT.

Known Compatibility Issues

Works for everyone...most of my scripts works with everybody.

Author's Notes


Why specific? Why not backup all? Note that this script is for people who want to do specific backups for their files. Say for example you only want to backup a certain saved file prior in a future save, you can copy / backup it and put it on a sample folder called backup.

Terms of Use


You can freely change, adapt and remix my script, but NOT the FileUtils module, as it is not mine. Anything that is not listed under my script is not in my jurisdiction to say whether its free to change or share. My script is free for non-commercial and commercial usage.
« Last Edit: February 15, 2015, 04:55:45 PM by SoulPour777 »


If you like my work, please do support me on Patreon.
https://www.patreon.com/Soulpour777?ty=h

*
Rep:
Level 72
~Few people understand the beauty of the night~
2014 Best Topic
This is actually reetty awesome! Good job!
Download http://a.tumblr.com/tumblr_lm5v281q6E1qde50fo1.mp3