made rsync args an argument because users wants to keep mtimes; updated copyright years
authorMatthias Förste <foerste@schlittermann.de>
Mon, 13 Feb 2017 16:25:06 +0100
changeset 28 924723fc873e
parent 27 7debeb182289
child 29 a589fb3599fb
made rsync args an argument because users wants to keep mtimes; updated copyright years
debian/copyright
wgnd-watch.pl
--- a/debian/copyright	Thu Dec 03 10:40:51 2015 +0100
+++ b/debian/copyright	Mon Feb 13 16:25:06 2017 +0100
@@ -12,7 +12,7 @@
 
 Copyright:
 
-    Copyright (C) 2012-2015 Matthias Förste
+    Copyright (C) 2012-2017 Matthias Förste
 
 License:
 
@@ -34,6 +34,6 @@
 
 The Debian packaging is:
 
-    Copyright (C) 2012-2015 Matthias Förste <foerste@schlittermann.de>
+    Copyright (C) 2012-2017 Matthias Förste <foerste@schlittermann.de>
 
 and is licensed under the GPL version 3, see above.
--- a/wgnd-watch.pl	Thu Dec 03 10:40:51 2015 +0100
+++ b/wgnd-watch.pl	Mon Feb 13 16:25:06 2017 +0100
@@ -1,6 +1,6 @@
 #!/usr/bin/perl
 
-#    Copyright (C) 2012-2015  Matthias Förste
+#    Copyright (C) 2012-2017  Matthias Förste
 #
 #    This program is free software: you can redistribute it and/or modify
 #    it under the terms of the GNU General Public License as published by
@@ -61,13 +61,17 @@
 my %opts = (
     daemon  => 1,
     map     => 'wgnd-watch.map.pl',
-    pidfile => '/var/run/wgnd-watch.pid'
+    pidfile => '/var/run/wgnd-watch.pid',
+    'rsync-args' => [ qw(-ihv -aAX --no-times) ],
+    'rsync-cmd' => '/usr/bin/rsync'
 );
 
 GetOptions(
     "map=s"     => \$opts{map},
     "daemon!"   => \$opts{daemon},
     "pidfile=s" => \$opts{pidfile},
+    "rsync-args=s@" => \$opts{'rsync-args'},
+    "rsync-cmd=s" => \$opts{'rsync-cmd'},
     "h|help!"   => sub { pod2usage(-verbose => 0, -exitval => 0) },
     "m|man!"    => sub {
         pod2usage(
@@ -110,7 +114,7 @@
 
 my $inotify = new Linux::Inotify2
   or die "Can't create new inotify object: $!\n";
-my @rsync = qw(/usr/bin/rsync -ihv -aAX);
+my @rsync = ($opts{'rsync-cmd'}, @{$opts{'rsync-args'}});
 
 for (keys %{$source}) {
 
@@ -198,6 +202,19 @@
 Location of the pid file. This is ignored unless we are running as a daemon.
 Defaults to F</var/run/wgnd-watch.pid>.
 
+=item B<--pidfile> I<filename>
+
+Location of the pid file. This is ignored unless we are running as a daemon.
+Defaults to F</var/run/wgnd-watch.pid>.
+
+=item B<--rsync-args> I<args>
+
+Arguments to pass to the rsync command. May be given multiple times. Defaults to B<-ihv -aAX --no-times>.
+
+=item B<--rsync-cmd> I<cmd>
+
+Rsync Command. Defaults to F</usr/bin/rsync>.
+
 =back
 
 =head1 FILES