summaryrefslogtreecommitdiff
path: root/source3/client
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1998-04-02 01:01:24 +0000
committerJeremy Allison <jra@samba.org>1998-04-02 01:01:24 +0000
commit612cbb6a6039c2cafb3de5e644f23a2a26d6c645 (patch)
tree8170678ed3ed75b7411cfd8d7387940783069ffc /source3/client
parentd99d6f0d2e956037f5a60250b044ccdde9d6a330 (diff)
downloadsamba-612cbb6a6039c2cafb3de5e644f23a2a26d6c645.tar.gz
samba-612cbb6a6039c2cafb3de5e644f23a2a26d6c645.tar.bz2
samba-612cbb6a6039c2cafb3de5e644f23a2a26d6c645.zip
Patch from Chris Maltby <chris@softway.com.au>. His comments follow:
+ improvement to smbtar to allow exclusion/inclusion of system and hidden files, and to generate a listing of what has been archived in a format useful for automated backup systems. + add the "Softq" spooling system to samba's printing capabilities. + I have "fixed" the intrusion of US style dates into samba reporting as well. The format yyyy/mm/dd is not only uunambiguous, but also has the benefit of making lexicographic sorts work correctly. Jeremy. (This used to be commit f9dacd1d8b89fccad859c0c6bc7a492823eb4b06)
Diffstat (limited to 'source3/client')
-rw-r--r--source3/client/clitar.c52
1 files changed, 46 insertions, 6 deletions
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index ccaab486d0..36cefeec55 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -48,6 +48,13 @@ BOOL tar_inc=False;
BOOL tar_reset=False;
/* Include / exclude mode (true=include, false=exclude) */
BOOL tar_excl=True;
+/* Dump files with System attribute */
+BOOL tar_system=False;
+/* Dump files with Hidden attribute */
+BOOL tar_hidden=True;
+/* Be noisy - make a catalogue */
+BOOL tar_noisy=True;
+
char tar_type='\0';
static char **cliplist=NULL;
static int clipn=0;
@@ -856,6 +863,16 @@ static void do_atar(char *rname,char *lname,file_info *finfo1)
DEBUG(4, ("skipping %s - archive bit not set\n", finfo.name));
shallitime=0;
}
+ else if (!tar_system && (finfo.mode & aSYSTEM))
+ {
+ DEBUG(4, ("skipping %s - system bit is set\n", finfo.name));
+ shallitime=0;
+ }
+ else if (!tar_hidden && (finfo.mode & aHIDDEN))
+ {
+ DEBUG(4, ("skipping %s - hidden bit is set\n", finfo.name));
+ shallitime=0;
+ }
else
{
if (SVAL(inbuf,smb_vwv0) == SMBreadX)
@@ -870,7 +887,7 @@ static void do_atar(char *rname,char *lname,file_info *finfo1)
datalen = 0;
}
- DEBUG(1,("getting file %s of size %d bytes as a tar file %s",
+ DEBUG(2,("getting file %s of size %d bytes as a tar file %s",
finfo.name,
finfo.size,
lname));
@@ -1135,9 +1152,16 @@ static void do_atar(char *rname,char *lname,file_info *finfo1)
get_total_size += finfo.size;
/* Thanks to Carel-Jan Engel (ease@mail.wirehub.nl) for this one */
- DEBUG(1,("(%g kb/s) (average %g kb/s)\n",
+ DEBUG(2,("(%g kb/s) (average %g kb/s)\n",
finfo.size / MAX(0.001, (1.024*this_time)),
get_total_size / MAX(0.001, (1.024*get_total_time_ms))));
+ if (tar_noisy)
+ {
+ printf("%10d (%7.1f kb/s) %s\n",
+ finfo.size, finfo.size / MAX(0.001, (1.024*this_time)),
+ finfo.name);
+ }
+
}
free(inbuf);free(outbuf);
@@ -1456,7 +1480,7 @@ void cmd_block(void)
}
blocksize=block;
- DEBUG(1,("blocksize is now %d\n", blocksize));
+ DEBUG(2,("blocksize is now %d\n", blocksize));
}
/****************************************************************************
@@ -1475,12 +1499,28 @@ void cmd_tarmode(void)
tar_reset=True;
else if (strequal(buf, "noreset"))
tar_reset=False;
+ else if (strequal(buf, "system"))
+ tar_system=True;
+ else if (strequal(buf, "nosystem"))
+ tar_system=False;
+ else if (strequal(buf, "hidden"))
+ tar_hidden=True;
+ else if (strequal(buf, "nohidden"))
+ tar_hidden=False;
+ else if (strequal(buf, "verbose") || strequal(buf, "noquiet"))
+ tar_noisy=True;
+ else if (strequal(buf, "quiet") || strequal(buf, "noverbose"))
+ tar_noisy=False;
else DEBUG(0, ("tarmode: unrecognised option %s\n", buf));
}
- DEBUG(0, ("tarmode is now %s, %s\n",
+ DEBUG(0, ("tarmode is now %s, %s, %s, %s, %s\n",
tar_inc ? "incremental" : "full",
- tar_reset ? "reset" : "noreset"));
+ tar_system ? "system" : "nosystem",
+ tar_hidden ? "hidden" : "nohidden",
+ tar_reset ? "reset" : "noreset",
+ tar_noisy ? "verbose" : "quiet"));
+
}
/****************************************************************************
@@ -1533,7 +1573,7 @@ void cmd_setmode(void)
return;
}
- DEBUG(1, ("\nperm set %d %d\n", attra[ATTRSET], attra[ATTRRESET]));
+ DEBUG(2, ("\nperm set %d %d\n", attra[ATTRSET], attra[ATTRRESET]));
(void) do_setrattr(fname, attra[ATTRSET], ATTRSET);
(void) do_setrattr(fname, attra[ATTRRESET], ATTRRESET);
}