Quantcast
Channel: 7zbackup - PowerShell Script to Backup Files with 7zip
Viewing all 48 articles
Browse latest View live

Commented Unassigned: Encoding error: cyrilic file names, cant remove archive bit [22541]

$
0
0
If use hardcoded args for 7-zip stdout to encode in UTF-8, then file names stored in Compress-Detail.txt can't be readed later, when used __Join-Path__ on Russian Windows :
```
$item = Get-Item -LiteralPath (Join-Path $BkRootDir $BkCompressDetailItems[$i].File)
```
Example Compress-Detail.txt:
```
Creating archive C:\backup\automatic\bcp\Bcp-full-20170619-211400.7z
Compressing Catalog-Include.txt
Compressing Catalog-Exclude.csv
Compressing bcp\╤Б╤Д╨Б╨║╨╗╤Л.txt
Everything is Ok
```


Normal output must be:
```
PS C:\_bcp> ls
------ 23.03.2017 10:07 24576 КУРЬЕРЫ ТЕЛЕФОНЫ.doc
------ 19.06.2017 21:02 808 сфЁклы.txt

```
Changing args param from UTF-8
```
$Bk7ZipArgs += "-sccUTF-8"
```
to
```
$Bk7ZipArgs += "-sccWIN"
```
fix this problem..
tested on version 2.0.4, 2.0.6
Comments: ** Comment from web user: Anlan **

Thank you Azudim for your feedback.
I will double check it as I recall with -sccWIN I had problems with accented letters.
Will keep you informed.


New Post: Archive Attrs is not cleared

$
0
0
We found the solution. Codepage of command line must be setted to UTF-8.

You can do it from command line or as part of script file: chcp 65001
or you can prepare command line to UTF-8 support via registry:

REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont" /v 000 /t REG_SZ /d "Lucida Console"

REG ADD HKCU\Console /v CodePage /t REG_DWORD /d 65001 /f

REG ADD HKCU\Console /v FaceName /t REG_SZ /d "Lucida Console" /f


On Windows Server 2008 R2 (or maybe some other old systems) you cant change codepage from cmd using 'chcp 65001' because of font, then use regedit to change it globaly for current user, as mentioned above.

Commented Unassigned: Encoding error: cyrilic file names, cant remove archive bit [22541]

$
0
0
If use hardcoded args for 7-zip stdout to encode in UTF-8, then file names stored in Compress-Detail.txt can't be readed later, when used __Join-Path__ on Russian Windows :
```
$item = Get-Item -LiteralPath (Join-Path $BkRootDir $BkCompressDetailItems[$i].File)
```
Example Compress-Detail.txt:
```
Creating archive C:\backup\automatic\bcp\Bcp-full-20170619-211400.7z
Compressing Catalog-Include.txt
Compressing Catalog-Exclude.csv
Compressing bcp\╤Б╤Д╨Б╨║╨╗╤Л.txt
Everything is Ok
```

Normal output must be:
```
PS C:\_bcp> ls
------ 23.03.2017 10:07 24576 КУРЬЕРЫ ТЕЛЕФОНЫ.doc
------ 19.06.2017 21:02 808 сфЁклы.txt

fix this problem:
Codepage of command line must be setted to UTF-8.

You can do it from command line or as part of script file: chcp 65001
or you can prepare command line to UTF-8 support via registry:

REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont" /v 000 /t REG_SZ /d "Lucida Console"

REG ADD HKCU\Console /v CodePage /t REG_DWORD /d 65001 /f

REG ADD HKCU\Console /v FaceName /t REG_SZ /d "Lucida Console" /f
Comments: ** Comment from web user: Azudim **

I updated my post with solution we found! So no need to change your script!

New Post: Migration due to CodePlex shut down?

$
0
0
Hi,

With the announcement to shutdown CodePlex, I wondered whether there were any plans to migrate the project elsewhere?

Thanks,
Paul

Updated Wiki: Home

$
0
0

We have moved to GitHub : https://github.com/Isiweb/7zBackup

Project Description
7zbackup is a PowerShell script aimed to help you automate your backup on-file tasks. 7zbackup leverages the great compression performances offered by 7zip while offering the great option to have different file sources stored in a single compressed archive.


Please Donate

Do you like this piece of software ? Why not consider helping me with a Donation ?


Abstract
Backup, Backup and again Backup. How many times have you heard this ? A good backup strategy is vital for any IT Infrastructure regardless their dimensions. Off-site backups are, without any doubt, the corner stone of those strategies but nowadays, the increased availability of on-disk space (larger disks, NAS, SANs), is a great help if you want toincrease your backup frequencies using on-line attached media.
That's why, in my personal experience, I make intensive usage of the "old pal" NtBackup to keep on disk different copies of Full/Incremental/Differential backups of my data and, of course, data from my customers. But while NtBackup is a good companion it lacks in one particular aspect: it waste a huge amount of bytes. Every .bkf file is plus the sum of all the data backed up.
So ... if you have space ... why waste space ? There comes in mind the obvious answer:use compression.
There are a lot of compression tools out there but none of them have succeded in my very personal expectations, till I found7-zip: it's free, it's small, it's fast, it's effective.
There are a few drawbacks though: mainly the unability by 7zip to select files on specific criteria and to bind several sources in one archive unless you do it manually (many have encountered the "Duplicated File Name" problem).
So I decided to write this small script which acts, substantially, as a selection wrapper for 7zip.

What 7zbackup.ps1 IS

  • It allows you to select files to backup using mostly the criteria of their "Archive" attribute which helps in building up catalogs to backup for Full, Differential and Incremental strategy
  • It extends the selection criteria with several regular expression directives. You can fine tune the directories to dig into and file types/names to include or exclude.
  • It prepares a list of files from which 7-zip reads which files are to insert into archive
  • It resolves the oddity of "Duplicate File Name" of 7-zip: with the proper usage of Junction points on NTFS file system the whole selection stays under one single root and all files in the list catalog report a relative path
  • It resets "Archive" attribute of archived files only if they're properly processed. This is relevant if you backup using differential and or incremental methods.
  • It keeps your backup archives in order eliminating the "older" ones.
  • It can help you cleaning up your directory structure from unwanted files
  • ... in few words a small and free backup on-file solution


What 7zbackup.ps1 IS NOT and what it can't do

  • It's NOT a disaster recovery tool.
  • It can't save the state of your running machine.
  • It can't save ACLs of files into archives
  • It can't save the complete directory tree of your sources. Empty directories are not considered. It now can save empty directories (since version 1.9.9) by the usage of dummy .7zdir files.
  • It can't perform any restore operation. If you need to restore any file simply use 7-zip File Manager to open the generated archive and extract files you need.
  • It can't replace any of your off-site backup strategies.


Please read. Please ...
This script makes use of Junction points (or Symbolic Links for Windows Vista/7/2008) typically placed in C: drive (root). These NTFS objects are displayed as folders in your Explorer interface. If, for any reason, the script should interrupt abnormally, it's generated junction points or symbolic links,  may remain on disk. DO NOT USE WINDOWS EXPLORER TO DELETE JUNCTIONS OR SYMBOLIC LINKS AS IT TRAVERSES THE LINK AND MAY REMOVE YOUR REAL FILES AND FOLDERS.

To remove a junction point use junction.exe with the -d switch.
To remove a symbolic link use the RD command line.


System Requirements

  • Windows XP, Windows Vista or better, Windows 2003 or better. (Might also work on Windows 2000 but there is some work to do for having PowerShell running on that platform)
  • NTFS File System
  • PowerShell 2.0 or better
  • 7-zip 9.2.0 or newest
  • SysInternals' Junction Tool v. 1.0.5 ( not required if running Windows Vista / 7 / 2008)


Features

  • Backup your files in compressed archives by 7-zip
  • Full, Differential, Incremental and Copy Backups
  • Option to move files into archives
  • Flexible selection of files and paths using regular expressions
  • Automatic removal of "old" backup archives (rotation)
  • Can remove unwanted files during the scan process
  • Send log of operations via email
  • Pre and Post operations can help back up databases and / or upload backup archive to external destinations
  • Easily manageable like a script is
  • Easily schedule your backup operations (using task scheduler)

Released: 7zBackup v. 2.0.4 Stable (Nov 12, 2016)

$
0
0

We have moved to GitHub : https://github.com/Isiweb/7zBackup

Donationware development

Do you like this piece of software ? It took some time and effort to develop.
Please consider supporting the development with a donation by clicking here

This is the NEED 4 SPEED release

Roughly all the code has been refactored to achieve better performance during the scan process. Usage of Out-File has been completely removed in favour of System.IO.StreamWriter. No more illogical waits for the scanning process to take almost longer than the archiving process itself. Speed gains while scanning are now from 5x (minum) up to 20x

You also have now the opportunity to invoke pre and post actions: for example you might want to dump a sqlexpress database before the scanning begins (pre) and then upload the generated archive to an ftp server (post) (see 7zbackup-vars.ps1 for examples)

Change Log since (2.0.3)

  • Code : Minor Code Fixes
  • Feat : Added support for volumized archives by --volumes switch. Volumes are also taken into account in the rotation strategy.

Updated Release: 7zBackup v. 2.0.4 Stable (nov 12, 2016)

$
0
0

We have moved to GitHub : https://github.com/Isiweb/7zBackup

Donationware development

Do you like this piece of software ? It took some time and effort to develop.
Please consider supporting the development with a donation by clicking here

This is the NEED 4 SPEED release

Roughly all the code has been refactored to achieve better performance during the scan process. Usage of Out-File has been completely removed in favour of System.IO.StreamWriter. No more illogical waits for the scanning process to take almost longer than the archiving process itself. Speed gains while scanning are now from 5x (minum) up to 20x

You also have now the opportunity to invoke pre and post actions: for example you might want to dump a sqlexpress database before the scanning begins (pre) and then upload the generated archive to an ftp server (post) (see 7zbackup-vars.ps1 for examples)

Change Log since (2.0.3)

  • Code : Minor Code Fixes
  • Feat : Added support for volumized archives by --volumes switch. Volumes are also taken into account in the rotation strategy.

New Post: Migration due to CodePlex shut down?


Viewing all 48 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>