This project is read-only.

ArchiveBytes.Windows.CS-Script.1.0

Rating: No reviews yet
Downloads: 37
Released: Jan 21, 2010
Updated: Jan 21, 2010 by potentZilla
Dev status: Stable Help Icon

Recommended Download

Application ArchiveBytes.Windows.CS-Script.1.0.zip
application, 926K, uploaded Jan 21, 2010 - 37 downloads

Release Notes

ArchiveBytes.Windows.CS-Script.1.0

The files gathered for ArchiveBytes.Windows.CS-Script.1.0. To use this release the ArchiveBytes.cs must be modifed to point to the directories you wish to backup and the target. You may use the helper library to perform common tasks in the backup routine.

Example code changes. To add a new repository job.

Define the repository definition in the list of ArchiveRepositories.

These are the target repositories for the archive to take all sources and copy the files to these targets. The number indicates the count of rolling backups to store in each archive repository. It is recommended to have the first ArchiveRepository as a local path and not a network path.
List<ArchiveRepositoryDefinition> ArchiveRepositories = new List<ArchiveRepositoryDefinition>() 
{ 
     new ArchiveRepositoryDefinition(@"G:\Archive Solution\x64Zilla.local",2) 
     ,new ArchiveRepositoryDefinition(@"\\phish-bowl\ArchiveSolution\x64Zilla.remote",3)
                    
};

Define the archive data jobs to execute.

These are the jobs to perform the work needed to prepare a target to archive. The parameter to the job is the path where the job should put its files. Most common task of a job is to zip the files and put the zip in the TargetPath location. The ArchiveBytes engine will pass the method the target location. The location is the first repository in the ArchiveRepositories list. It is recommended to have the first ArchiveRepository as a local path and not a network path.
Note, the archiveBytes.ArchiveDataJob is a delegate and jobs are added with the += after the first job has been added.

archiveBytes.ArchiveDataJob = new ArchiveData(ArchiveMyDocumentsData);
archiveBytes.ArchiveDataJob += new ArchiveData(ArchiveWorkspacesData);

Define a Job

The job is the task required to prepare a source for archive. Most typical task is to perform a ZIP of the source. You are free to perform any set of tasks to prepare a repository. The TargetPath is the destination of files in the job. Once the job is complete then ArchiveBytes will duplicate the initial repostiory to the rest of the repositories in the ArchiveRepositoryDefinition list.

In this example the job is calling the ZIP helper method which will take the source path and create the zip output into the target path. The 650 indicates each ZIP file should not be larger than 650 megabytes.
    static private void ArchiveMyDocumentsData(string TargetPath)
    {
        Zip(@"d:\Documents and Settings\UserName\My Documents\*", TargetPath, "MyDocuments", 650);        
    }

Execute ArchiveBytes.cs

To execute the script use cscs.exe with the .cs file as a command line parameter.
cscs.exe ArchiveBytes.cs


Reviews for this release

No reviews yet for this release.