-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
228 additions
and
116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,39 +33,77 @@ Use -h to show a help: | |
|
||
```text | ||
> ./cronlog-sync.sh -h | ||
____________________________________________________________________________________ | ||
SYNC LOCAL LOGS OF www.example.com | ||
______________________________________________________________________________/ v1.5 | ||
HELP: | ||
This script syncs local cronlogs to a target. | ||
It should be used as cronjob in /etc/cron.d/ and/ or triggered | ||
whem any cronwrapper script was fisnished. | ||
SYNTAX: | ||
cronlog-sync.sh [OPTIONS] | ||
PRAMETERS: | ||
-f [integer] time in sec when to force symc without new logs | ||
value 0 forces sync | ||
current value: [3600] | ||
-h show this help | ||
-i [string] path to ssh private key file | ||
current value: [/home/copy-cronlogs/.ssh/[email protected]] | ||
-l [string] local log dir of cronjobs | ||
current value: [/var/tmp/cronlogs] | ||
-q be more quiet | ||
-s [integer] sleep random time .. maximum is given value in seconds | ||
-t [string] target dir (local or remote like rsync syntax) | ||
current value: [[email protected]:/var/tmp/allcronlogs/www.example.com] | ||
DEFAULTS: | ||
see also /opt/cronwrapper/cronwrapper.cfg | ||
EXAMPLES: | ||
cronlog-sync.sh -s 20 -t [TARGET] wait max 20 sec before starting sync | ||
cronlog-sync.sh -q -f 0 be more quiet and force sync (0 sec) | ||
______________________________________________________________________________ | ||
AXELS CRONWRAPPER | ||
SYNC LOCAL LOGS OF π₯ linux-pc | ||
v 2.0 | ||
______________________________________________________________________________ | ||
This script syncs local cronlogs to a target. | ||
It should be used as cronjob in /etc/cron.d/ and/ or triggered | ||
whem any cronwrapper script was fisnished. | ||
This script is part of Axels Cronwrapper. | ||
π Docs : https://www.axel-hahn.de/docs/cronwrapper/ | ||
π License: GNU GPL 3.0 | ||
####| β¨ SYNTAX |#### | ||
cronlog-sync.sh [OPTIONS] | ||
####| π§ OPTIONS |#### | ||
-f [integer] time in sec when to force symc without new logs | ||
value 0 forces sync | ||
current value: [3600] | ||
-h show this help | ||
-i [string] path to ssh private key file | ||
current value: | ||
[/root/.ssh/[email protected]] | ||
-l [string] local log dir of cronjobs | ||
current value:[/var/tmp/cronlogs] | ||
-q be more quiet | ||
-s [integer] sleep random time .. maximum is given value in seconds | ||
-t [string] target dir (local or remote like rsync syntax) | ||
current value: | ||
[[email protected]:/var/tmp/allcronlogs/linux-pc] | ||
####| π· DEFAULTS |#### | ||
see ./cronwrapper.cfg | ||
####| 𧩠EXAMPLES |#### | ||
cronlog-sync.sh -s 20 -t [TARGET] | ||
Wait max. 20 sec before starting sync to a custom target | ||
cronlog-sync.sh -q -f 0 | ||
be more quiet and force sync (0 sec) | ||
####| β EXITCODES |#### | ||
0 OK. Action ended as expected. No sync needed or sync was done. | ||
1 Missing parameter | ||
2 Invalid option | ||
3 No FQDN was found in hostname | ||
4 No target was set in configuration | ||
5 Target is still example.com | ||
6 Logdir with files to sync was not found | ||
7 rsync of local logs to target failed | ||
``` | ||
|
||
|
Oops, something went wrong.