Showing posts with label batch. Show all posts
Showing posts with label batch. Show all posts

Thursday, May 26, 2011

#listing files in a remote git repository

here is a small batch script for windows (msysgit) that will list the files from a certain branch in a remote git repository. i wrote the initial script some time ago because i wanted git have this functionality with a single cmd line, but finished it just yesterday.

git_lrt.zip

it works as follows:
git_lrt some-url some-branch
git_lrt some-url some-branch > logfile.log


if no branch is given 'master' will be used.

what it does is (if you want to port to linux bash for example):
- create local temp folder
- init a git repository in there
- add remote from url
- fetch objects
- list remote files for branch
- clear local temp folder (& repository)

you may find the script useful to check the contents before cloning a small repository to your local windows hard drive. it seems there might be a possible vulnerability in msysgit where files that are part of the repository can be written to system folders. an example that mr. tale gives:
cockos forum post

--

Tuesday, February 15, 2011

#win32: automatic backup script for 7za

here is a small batch script for windows that will periodically create a zip backup of a certain folder with 7za.

on the top of the 'backup.cmd' it is possible to set:
- source path (folder where 'backup.cmd' is by default)
- target path
- update period (minutes)
- excluded files and sub-folders (7za option)
- other compressor options
(for more information about 7za options see: '7za -h')

just check the above settings and place the file in the project folder you wish to backup.
the result will be written at the 'target path' as 'foldername_date_timestamp.zip'.
it can be easily modified so that another compressor is used.

download link