rsync the info to a file
Clash Royale CLAN TAG#URR8PPP
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;
up vote
0
down vote
favorite
I use rsync to backup my data from one server to the other. This works great.
rsync -aktvu -e 'ssh -p 22' --modify-window=1 --progress $SOURCE $USER@$SERVER:$DESTINATION
The output display what has been copied over:
building file list ...
11 files to consider
./
server/
server/myfile.txt
3152 100% 0.00kB/s 0:00:00 (xfer#1, to-check=8/11)
server/test/
server/test/logfile01
8266 100% 7.88MB/s 0:00:00 (xfer#2, to-check=6/11)
server/test/logfile07
41004 100% 39.10MB/s 0:00:00 (xfer#3, to-check=5/11)
server/test/logfile08
318 100% 310.55kB/s 0:00:00 (xfer#4, to-check=4/11)
server/test/logfile09
8262 100% 7.88MB/s 0:00:00 (xfer#5, to-check=3/11)
server/test/logfile30
40325 100% 12.82MB/s 0:00:00 (xfer#6, to-check=2/11)
server/test/logfile31
792 100% 193.36kB/s 0:00:00 (xfer#7, to-check=1/11)
server/test/logfile32
3152 100% 769.53kB/s 0:00:00 (xfer#8, to-check=0/11)
sent 105902 bytes received 214 bytes 14148.80 bytes/sec
total size is 105271 speedup is 0.99
I would like to get this output and save it to a file for reference. So I tried this,
test_output=$(rsync -aktvu -e 'ssh -p 22' --modify-window=1 --progress $SOURCE $USER@$SERVER:$DESTINATION)
getscript()
pgrep -lf ".[ /]$1(
getscript "sync.sh" >/dev/null && echo "sync.sh" $test_output >> outputfile.txt;
It works great but the output are all on one line. It's not nicely indented like above. How can I output it so it will be nicely indented?
tks
shell-script rsync
add a comment |Â
up vote
0
down vote
favorite
I use rsync to backup my data from one server to the other. This works great.
rsync -aktvu -e 'ssh -p 22' --modify-window=1 --progress $SOURCE $USER@$SERVER:$DESTINATION
The output display what has been copied over:
building file list ...
11 files to consider
./
server/
server/myfile.txt
3152 100% 0.00kB/s 0:00:00 (xfer#1, to-check=8/11)
server/test/
server/test/logfile01
8266 100% 7.88MB/s 0:00:00 (xfer#2, to-check=6/11)
server/test/logfile07
41004 100% 39.10MB/s 0:00:00 (xfer#3, to-check=5/11)
server/test/logfile08
318 100% 310.55kB/s 0:00:00 (xfer#4, to-check=4/11)
server/test/logfile09
8262 100% 7.88MB/s 0:00:00 (xfer#5, to-check=3/11)
server/test/logfile30
40325 100% 12.82MB/s 0:00:00 (xfer#6, to-check=2/11)
server/test/logfile31
792 100% 193.36kB/s 0:00:00 (xfer#7, to-check=1/11)
server/test/logfile32
3152 100% 769.53kB/s 0:00:00 (xfer#8, to-check=0/11)
sent 105902 bytes received 214 bytes 14148.80 bytes/sec
total size is 105271 speedup is 0.99
I would like to get this output and save it to a file for reference. So I tried this,
test_output=$(rsync -aktvu -e 'ssh -p 22' --modify-window=1 --progress $SOURCE $USER@$SERVER:$DESTINATION)
getscript()
pgrep -lf ".[ /]$1(
getscript "sync.sh" >/dev/null && echo "sync.sh" $test_output >> outputfile.txt;
It works great but the output are all on one line. It's not nicely indented like above. How can I output it so it will be nicely indented?
tks
shell-script rsync
1
What's the reason for yourgetscript
function?
â Kusalananda
Aug 3 at 17:30
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I use rsync to backup my data from one server to the other. This works great.
rsync -aktvu -e 'ssh -p 22' --modify-window=1 --progress $SOURCE $USER@$SERVER:$DESTINATION
The output display what has been copied over:
building file list ...
11 files to consider
./
server/
server/myfile.txt
3152 100% 0.00kB/s 0:00:00 (xfer#1, to-check=8/11)
server/test/
server/test/logfile01
8266 100% 7.88MB/s 0:00:00 (xfer#2, to-check=6/11)
server/test/logfile07
41004 100% 39.10MB/s 0:00:00 (xfer#3, to-check=5/11)
server/test/logfile08
318 100% 310.55kB/s 0:00:00 (xfer#4, to-check=4/11)
server/test/logfile09
8262 100% 7.88MB/s 0:00:00 (xfer#5, to-check=3/11)
server/test/logfile30
40325 100% 12.82MB/s 0:00:00 (xfer#6, to-check=2/11)
server/test/logfile31
792 100% 193.36kB/s 0:00:00 (xfer#7, to-check=1/11)
server/test/logfile32
3152 100% 769.53kB/s 0:00:00 (xfer#8, to-check=0/11)
sent 105902 bytes received 214 bytes 14148.80 bytes/sec
total size is 105271 speedup is 0.99
I would like to get this output and save it to a file for reference. So I tried this,
test_output=$(rsync -aktvu -e 'ssh -p 22' --modify-window=1 --progress $SOURCE $USER@$SERVER:$DESTINATION)
getscript()
pgrep -lf ".[ /]$1(
getscript "sync.sh" >/dev/null && echo "sync.sh" $test_output >> outputfile.txt;
It works great but the output are all on one line. It's not nicely indented like above. How can I output it so it will be nicely indented?
tks
shell-script rsync
I use rsync to backup my data from one server to the other. This works great.
rsync -aktvu -e 'ssh -p 22' --modify-window=1 --progress $SOURCE $USER@$SERVER:$DESTINATION
The output display what has been copied over:
building file list ...
11 files to consider
./
server/
server/myfile.txt
3152 100% 0.00kB/s 0:00:00 (xfer#1, to-check=8/11)
server/test/
server/test/logfile01
8266 100% 7.88MB/s 0:00:00 (xfer#2, to-check=6/11)
server/test/logfile07
41004 100% 39.10MB/s 0:00:00 (xfer#3, to-check=5/11)
server/test/logfile08
318 100% 310.55kB/s 0:00:00 (xfer#4, to-check=4/11)
server/test/logfile09
8262 100% 7.88MB/s 0:00:00 (xfer#5, to-check=3/11)
server/test/logfile30
40325 100% 12.82MB/s 0:00:00 (xfer#6, to-check=2/11)
server/test/logfile31
792 100% 193.36kB/s 0:00:00 (xfer#7, to-check=1/11)
server/test/logfile32
3152 100% 769.53kB/s 0:00:00 (xfer#8, to-check=0/11)
sent 105902 bytes received 214 bytes 14148.80 bytes/sec
total size is 105271 speedup is 0.99
I would like to get this output and save it to a file for reference. So I tried this,
test_output=$(rsync -aktvu -e 'ssh -p 22' --modify-window=1 --progress $SOURCE $USER@$SERVER:$DESTINATION)
getscript()
pgrep -lf ".[ /]$1(
getscript "sync.sh" >/dev/null && echo "sync.sh" $test_output >> outputfile.txt;
It works great but the output are all on one line. It's not nicely indented like above. How can I output it so it will be nicely indented?
tks
shell-script rsync
asked Aug 3 at 17:13
Tran
1
1
1
What's the reason for yourgetscript
function?
â Kusalananda
Aug 3 at 17:30
add a comment |Â
1
What's the reason for yourgetscript
function?
â Kusalananda
Aug 3 at 17:30
1
1
What's the reason for your
getscript
function?â Kusalananda
Aug 3 at 17:30
What's the reason for your
getscript
function?â Kusalananda
Aug 3 at 17:30
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
2
down vote
man rsync
will show an option to log output to a logfile:
--log-file=FILE
This option causesrsync
to log what it is doing to a file. This is similar to the logging
that a daemon does, but can be requested for the client side and/or the server side of a
non-daemon transfer. If specified as a client option, transfer logging will be enabled with a
default format of"%i %n%L"
. See the--log-file-format
option if you wish to override this.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
man rsync
will show an option to log output to a logfile:
--log-file=FILE
This option causesrsync
to log what it is doing to a file. This is similar to the logging
that a daemon does, but can be requested for the client side and/or the server side of a
non-daemon transfer. If specified as a client option, transfer logging will be enabled with a
default format of"%i %n%L"
. See the--log-file-format
option if you wish to override this.
add a comment |Â
up vote
2
down vote
man rsync
will show an option to log output to a logfile:
--log-file=FILE
This option causesrsync
to log what it is doing to a file. This is similar to the logging
that a daemon does, but can be requested for the client side and/or the server side of a
non-daemon transfer. If specified as a client option, transfer logging will be enabled with a
default format of"%i %n%L"
. See the--log-file-format
option if you wish to override this.
add a comment |Â
up vote
2
down vote
up vote
2
down vote
man rsync
will show an option to log output to a logfile:
--log-file=FILE
This option causesrsync
to log what it is doing to a file. This is similar to the logging
that a daemon does, but can be requested for the client side and/or the server side of a
non-daemon transfer. If specified as a client option, transfer logging will be enabled with a
default format of"%i %n%L"
. See the--log-file-format
option if you wish to override this.
man rsync
will show an option to log output to a logfile:
--log-file=FILE
This option causesrsync
to log what it is doing to a file. This is similar to the logging
that a daemon does, but can be requested for the client side and/or the server side of a
non-daemon transfer. If specified as a client option, transfer logging will be enabled with a
default format of"%i %n%L"
. See the--log-file-format
option if you wish to override this.
answered Aug 3 at 19:18
roaima
39.2k544105
39.2k544105
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f460386%2frsync-the-info-to-a-file%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
1
What's the reason for your
getscript
function?â Kusalananda
Aug 3 at 17:30