Adds missing / in mount point specification

Adds example configuration file
This commit is contained in:
Andrea Mazzoleni 2011-03-12 10:23:42 +01:00
parent 496971e9c9
commit 2feefb4ac7
7 changed files with 51 additions and 27 deletions

View file

@ -42,8 +42,11 @@ EXTRA_DIST = \
README AUTHORS HISTORY INSTALL COPYING \ README AUTHORS HISTORY INSTALL COPYING \
snapraid.d snapraid.1 snapraid.txt snapraid.html \ snapraid.d snapraid.1 snapraid.txt snapraid.html \
test.conf \ test.conf \
snapraid.conf.example \
acinclude.m4 acinclude.m4
man_MANS = snapraid.1
clean-local: clean-local:
rm -f valgrind.log callgrind.log rm -f valgrind.log callgrind.log
rm -rf test rm -rf test

13
elem.c
View file

@ -96,6 +96,19 @@ struct snapraid_disk* disk_alloc(const char* name, const char* dir)
disk = malloc_nofail(sizeof(struct snapraid_disk)); disk = malloc_nofail(sizeof(struct snapraid_disk));
snprintf(disk->name, sizeof(disk->name), "%s", name); snprintf(disk->name, sizeof(disk->name), "%s", name);
snprintf(disk->dir, sizeof(disk->dir), "%s", dir); snprintf(disk->dir, sizeof(disk->dir), "%s", dir);
/* ensure that the dir terminate with "/" if it isn't empty */
if (disk->dir[0] != 0) {
char last = disk->dir[strlen(disk->dir) - 1];
if (last != '/'
#ifdef _WIN32
&& last != '\\'
#endif
) {
snprintf(disk->dir, sizeof(disk->dir), "%s/", dir);
}
}
disk->first_free_block = 0; disk->first_free_block = 0;
tommy_list_init(&disk->filelist); tommy_list_init(&disk->filelist);
tommy_hashdyn_init(&disk->fileset); tommy_hashdyn_init(&disk->fileset);

27
snapraid.conf.example Normal file
View file

@ -0,0 +1,27 @@
# Configuration for snapraid
# Define the block size in kilo bytes (1024 bytes).
# Format: "block_size SIZE_IN_KB"
# Default value is 128 -> 128 kilo bytes
block_size 128
# Define the file to use as parity storage
# It must me in an different disk than the data disk
# Format: "parity FILE_PATH"
parity /mnt/dp/parity
# Define the file to use as content list
# Format: "content FILE_PATH"
# It must me in an different disk than the data disk
# It can be in the same disk used for parity storage
content /mnt/dp/content
# Define to data disk to use
# Format: "disk DISK_NAME DISK_MOUNT_POINT"
disk d1 /mnt/d1/
disk d2 /mnt/d2/
disk d3 /mnt/d3/
disk d4 /mnt/d4/
disk d5 /mnt/d5/
disk d6 /mnt/d6/

View file

@ -196,12 +196,7 @@ Options
For example, it happens if all the files in a disk are For example, it happens if all the files in a disk are
missing. missing.
-e, --exclude PATTERN -v, --verbose
This option define an exclusion pattern to be applyed at
the files with the "sync" command. It has no effect with
other commands.
-v, --verboe
Prints more information in the processing. Prints more information in the processing.
-h, --help -h, --help

View file

@ -53,7 +53,7 @@ You can stop using SnapRAID at any time.
</li> </li>
</ul> </ul>
<h2><a name="3">3</a> <h2><a name="3">3</a>
Misfeatures Limitations
</h2> </h2>
SnapRAID is in between a RAID and a backup program trying to get the best SnapRAID is in between a RAID and a backup program trying to get the best
benefits of them. Altough it also has some downsides that you should benefits of them. Altough it also has some downsides that you should
@ -310,16 +310,7 @@ missing.
</table> </table>
<table width="100%" border="0" cellspacing="0" cellpadding="2"> <table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr valign="top" align="left"><td><strong> <tr valign="top" align="left"><td><strong>
-e, --exclude PATTERN -v, --verbose
</strong></td></tr><tr><td>
This option define an exclusion pattern to be applyed at
the files with the "sync" command. It has no effect with
other commands.
</td></tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr valign="top" align="left"><td><strong>
-v, --verboe
</strong></td></tr><tr><td> </strong></td></tr><tr><td>
Prints more information in the processing. Prints more information in the processing.
</td></tr> </td></tr>

View file

@ -40,7 +40,7 @@ The main features of SnapRAID are:
You can stop using SnapRAID at any time. You can stop using SnapRAID at any time.
3 MISFEATURES 3 LIMITATIONS
============= =============
SnapRAID is in between a RAID and a backup program trying to get the best SnapRAID is in between a RAID and a backup program trying to get the best
@ -218,12 +218,7 @@ SnapRAID provides three simple commands that allow to:
For example, it happens if all the files in a disk are For example, it happens if all the files in a disk are
missing. missing.
-e, --exclude PATTERN -v, --verbose
This option define an exclusion pattern to be applyed at
the files with the "sync" command. It has no effect with
other commands.
-v, --verboe
Prints more information in the processing. Prints more information in the processing.
-h, --help -h, --help

View file

@ -1,7 +1,7 @@
block_size 1 block_size 1
parity test/parity parity test/parity
content test/content content test/content
disk d1 test/disk1/ disk d1 test/disk1
disk d2 test/disk2/ disk d2 test/disk2
disk d3 test/disk3/ disk d3 test/disk3