Overclock.net › Forums › Video Games › PC Gaming › [OPEN SOURCE] Automatic Steam Backup/Restore Tool
New Posts  All Forums:Forum Nav:

[OPEN SOURCE] Automatic Steam Backup/Restore Tool - Page 5

post #41 of 257
I would love to learn how to do things like this. I have only worked VB myself (somewhat).
MSI EX625
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core 2 Duo P7350 MSI MS-1674 ATI Radeon HD Mobility 4670 4GB 
Hard DriveOptical DriveOSMonitor
Samsung 320GB Sony CD/DVD writer Windows 7 Home 64-bit 16" 1366x768 
  hide details  
Reply
MSI EX625
(13 items)
 
  
CPUMotherboardGraphicsRAM
Intel Core 2 Duo P7350 MSI MS-1674 ATI Radeon HD Mobility 4670 4GB 
Hard DriveOptical DriveOSMonitor
Samsung 320GB Sony CD/DVD writer Windows 7 Home 64-bit 16" 1366x768 
  hide details  
Reply
post #42 of 257
The threads are basically restricted to the 7za.exe file. 7-Zip is managing threads, my app just starts 1x 7zip process for all the .GCF files, then each folder under common has its own process, but the process for common folders is done one at a time. (May fix that in next release)
    
CPUMotherboardGraphicsGraphics
FX-8350 Asus Crosshair V MSI GTX460 Hawk 1gb MSI GTX460 Hawk 1gb 
RAMHard DriveHard DriveHard Drive
Kingston HyperX 8gb (2x4gb) Crucial M4 64GB Samsung F3 1TB Western Digital 320GB 
CoolingOSMonitorMonitor
Custom WC Windows 7 Ultimate X64 Dell E2311H Dell E2311H 
MonitorKeyboardPowerCase
LH 23EN43 Ducky Year of the Dragon 2012 SilverStone Strider 1000W-P Corsair 800D 
Audio
Asus Xonar Essence STX 
  hide details  
Reply
    
CPUMotherboardGraphicsGraphics
FX-8350 Asus Crosshair V MSI GTX460 Hawk 1gb MSI GTX460 Hawk 1gb 
RAMHard DriveHard DriveHard Drive
Kingston HyperX 8gb (2x4gb) Crucial M4 64GB Samsung F3 1TB Western Digital 320GB 
CoolingOSMonitorMonitor
Custom WC Windows 7 Ultimate X64 Dell E2311H Dell E2311H 
MonitorKeyboardPowerCase
LH 23EN43 Ducky Year of the Dragon 2012 SilverStone Strider 1000W-P Corsair 800D 
Audio
Asus Xonar Essence STX 
  hide details  
Reply
post #43 of 257
Thread Starter 
well here is my idea of a way to multitasking. I know its hard to share arrays between thread when using VB so presuming its the same for C# but i have used a similar technique in VB

1. get all of the Directories that need to be backed up and add them to a Public Shared Array.
2. Start x number of threads (x = a user selected number)
3. each thread reads the last item in the array, deletes it then starts backing it up (it might be best to have a ~1ms delay between starting each thread just in case it tries to read the same array index)
4. keep doing this until the array is empty.
post #44 of 257
well, theres nothing i can do about the steamapps folder as its only 1 archive. but i can get all the common folders on different threads running concurrently
    
CPUMotherboardGraphicsGraphics
FX-8350 Asus Crosshair V MSI GTX460 Hawk 1gb MSI GTX460 Hawk 1gb 
RAMHard DriveHard DriveHard Drive
Kingston HyperX 8gb (2x4gb) Crucial M4 64GB Samsung F3 1TB Western Digital 320GB 
CoolingOSMonitorMonitor
Custom WC Windows 7 Ultimate X64 Dell E2311H Dell E2311H 
MonitorKeyboardPowerCase
LH 23EN43 Ducky Year of the Dragon 2012 SilverStone Strider 1000W-P Corsair 800D 
Audio
Asus Xonar Essence STX 
  hide details  
Reply
    
CPUMotherboardGraphicsGraphics
FX-8350 Asus Crosshair V MSI GTX460 Hawk 1gb MSI GTX460 Hawk 1gb 
RAMHard DriveHard DriveHard Drive
Kingston HyperX 8gb (2x4gb) Crucial M4 64GB Samsung F3 1TB Western Digital 320GB 
CoolingOSMonitorMonitor
Custom WC Windows 7 Ultimate X64 Dell E2311H Dell E2311H 
MonitorKeyboardPowerCase
LH 23EN43 Ducky Year of the Dragon 2012 SilverStone Strider 1000W-P Corsair 800D 
Audio
Asus Xonar Essence STX 
  hide details  
Reply
post #45 of 257
Thread Starter 
Quote:
Originally Posted by FiX View Post
well, theres nothing i can do about the steamapps folder as its only 1 archive. but i can get all the common folders on different threads running concurrently
I might make some pseudo code to explain my idea. give me about 10 minutes.
post #46 of 257
Ok
    
CPUMotherboardGraphicsGraphics
FX-8350 Asus Crosshair V MSI GTX460 Hawk 1gb MSI GTX460 Hawk 1gb 
RAMHard DriveHard DriveHard Drive
Kingston HyperX 8gb (2x4gb) Crucial M4 64GB Samsung F3 1TB Western Digital 320GB 
CoolingOSMonitorMonitor
Custom WC Windows 7 Ultimate X64 Dell E2311H Dell E2311H 
MonitorKeyboardPowerCase
LH 23EN43 Ducky Year of the Dragon 2012 SilverStone Strider 1000W-P Corsair 800D 
Audio
Asus Xonar Essence STX 
  hide details  
Reply
    
CPUMotherboardGraphicsGraphics
FX-8350 Asus Crosshair V MSI GTX460 Hawk 1gb MSI GTX460 Hawk 1gb 
RAMHard DriveHard DriveHard Drive
Kingston HyperX 8gb (2x4gb) Crucial M4 64GB Samsung F3 1TB Western Digital 320GB 
CoolingOSMonitorMonitor
Custom WC Windows 7 Ultimate X64 Dell E2311H Dell E2311H 
MonitorKeyboardPowerCase
LH 23EN43 Ducky Year of the Dragon 2012 SilverStone Strider 1000W-P Corsair 800D 
Audio
Asus Xonar Essence STX 
  hide details  
Reply
post #47 of 257
Thread Starter 
this is in rough VB. it took longer than 10 minutes but meh ;p

Code:
Public Class Form1

    Public Shared backupDir() As String
    Public Shared i As Integer = 0

    Public Sub btnBackup_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBackup.Click
        Dim sDir As Integer = tbxSteamDir.text
        Dim bDir As Integer = tbxBackupDir.text
        Dim numThreads As Integer = tbxNumThreads.text


        ' add steam apps to array
        backupDir(i) = Application.StartupPath & ".7za.exe a -t7z " & bDir & "\\steamapps.7z " & sDir & "\\steamapps\\* -mx9 -xr!common"
        i++

        ' add individual common folders to array
        For Each cmnFolder As String In IO.Directory.GetDirectories(sDir & "\\steamapps\\common")
            ' Get folder name
            Dim folder As String = ""
            For c = Len(cmnFolder) To 1 Step -1
                If Mid(cmnFolder, c, 1) = "\\" Then
                    Exit For
                Else
                    folder = Mid(cmnFolder, c, 1) & folder
                End If
            Next c
            ' Add to array
            backupDir(i) = Application.StartupPath & ".7za.exe a -t7z " & cmnFolder & "\\common\\" & folder & ".7z " & cmnFolder & " -mx9"
            i++
        Next

        'Start Threads
        Dim l As Integer
        While l <= numThreads
            ' start threads in here
        End While

    End Sub

    Public Class runThread
        ' do what you normally do in each thread but use the last index of backupDir(i) as the command deleting it as it gets used.
    End Class

End Class

Edited by Du-z - 3/25/11 at 1:14pm
post #48 of 257
I see what you are doing.. in the threads, the number of threads should be the length of the array.
    
CPUMotherboardGraphicsGraphics
FX-8350 Asus Crosshair V MSI GTX460 Hawk 1gb MSI GTX460 Hawk 1gb 
RAMHard DriveHard DriveHard Drive
Kingston HyperX 8gb (2x4gb) Crucial M4 64GB Samsung F3 1TB Western Digital 320GB 
CoolingOSMonitorMonitor
Custom WC Windows 7 Ultimate X64 Dell E2311H Dell E2311H 
MonitorKeyboardPowerCase
LH 23EN43 Ducky Year of the Dragon 2012 SilverStone Strider 1000W-P Corsair 800D 
Audio
Asus Xonar Essence STX 
  hide details  
Reply
    
CPUMotherboardGraphicsGraphics
FX-8350 Asus Crosshair V MSI GTX460 Hawk 1gb MSI GTX460 Hawk 1gb 
RAMHard DriveHard DriveHard Drive
Kingston HyperX 8gb (2x4gb) Crucial M4 64GB Samsung F3 1TB Western Digital 320GB 
CoolingOSMonitorMonitor
Custom WC Windows 7 Ultimate X64 Dell E2311H Dell E2311H 
MonitorKeyboardPowerCase
LH 23EN43 Ducky Year of the Dragon 2012 SilverStone Strider 1000W-P Corsair 800D 
Audio
Asus Xonar Essence STX 
  hide details  
Reply
post #49 of 257
Thread Starter 
Yup thats out in a nutshell. Don't run all the threads at once though.each instance of 7zip uses ~0.5GB of ram
post #50 of 257
Quote:
Originally Posted by Du-z View Post
Yup thats out in a nutshell. Don't run all the threads at once though.each instance of 7zip uses ~0.5GB of ram
Wow, really? I never noticed.... Might as well leave it where it is then (1 steamapps thread, and 1 common thread for each folder, although theres only 1 common thread running at a time.)
    
CPUMotherboardGraphicsGraphics
FX-8350 Asus Crosshair V MSI GTX460 Hawk 1gb MSI GTX460 Hawk 1gb 
RAMHard DriveHard DriveHard Drive
Kingston HyperX 8gb (2x4gb) Crucial M4 64GB Samsung F3 1TB Western Digital 320GB 
CoolingOSMonitorMonitor
Custom WC Windows 7 Ultimate X64 Dell E2311H Dell E2311H 
MonitorKeyboardPowerCase
LH 23EN43 Ducky Year of the Dragon 2012 SilverStone Strider 1000W-P Corsair 800D 
Audio
Asus Xonar Essence STX 
  hide details  
Reply
    
CPUMotherboardGraphicsGraphics
FX-8350 Asus Crosshair V MSI GTX460 Hawk 1gb MSI GTX460 Hawk 1gb 
RAMHard DriveHard DriveHard Drive
Kingston HyperX 8gb (2x4gb) Crucial M4 64GB Samsung F3 1TB Western Digital 320GB 
CoolingOSMonitorMonitor
Custom WC Windows 7 Ultimate X64 Dell E2311H Dell E2311H 
MonitorKeyboardPowerCase
LH 23EN43 Ducky Year of the Dragon 2012 SilverStone Strider 1000W-P Corsair 800D 
Audio
Asus Xonar Essence STX 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: PC Gaming
Overclock.net › Forums › Video Games › PC Gaming › [OPEN SOURCE] Automatic Steam Backup/Restore Tool