I am trying to rsync the data from one server to another, and approximately ~1.1T of data, but when am doing rsync I am getting following exception in the middle of transfer terminating the process.
rsync error: unexplained error (code 129) at rsync.c(541) [sender=3.0.7]
nohup rsync -r -t -v -o -g -p -c -l -z /source/images/ranker root#xx.xxxx.xxx.xx:/mnt/source/images &
Related
I'm working on a home automation system using a Raspberry Pi. As part of this, I'd like the rPi to pull a file from my web server once a minute. I've been using rsync, but I've run into an error I can't figure out.
This command works fine when run at the command line on my rPi:
rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null" --progress username#example.com:/home/user/example.com/cmd.txt /home/pi/sprinkler/input/cmd.txt
...but when it runs in cron, it produces this error in my log:
Unexpected local arg: /home/pi/sprinkler/input/
If arg is a remote file/dir, prefix it with a colon (:).
rsync error: syntax or usage error (code 1) at main.c(1375) [Receiver=3.1.2]
...and I just answered my own question. Extensive googling around didn't turn up an answer but I just tried putting my rsync command into a bash script, and running the script in cron instead of the command and now everything works!
I'll put this here in case anyone else stumbles over this issue. Here's a script I called "sync.sh"
#!/bin/bash
# attempting a bash shell to use rsync to grab our file
rsync -avz -e "ssh -o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null"
--progress user#example.com:/home/user/example.com/vinhus/tovinhus
/cmd.txt /home/pi/sprinkler/input/
All,
I am trying to run multiple shell commands on a remote server through Jenkins
I have tried the below code with Execute Shell, plugin
sudo su
ssh -o StrictHostKeyChecking=no -i /home/ec2-user/card.pem ec2-user#10.205.75.204 cat /home/ec2-user/testfile.txt
the problem with this is i can only run one command , for more than 1 I need to run
sudo su
ssh -o StrictHostKeyChecking=no -i /home/ec2-user/card.pem ec2-user#10.205.75.204 cat /home/ec2-user/testfile.txt
ssh -o StrictHostKeyChecking=no -i /home/ec2-user/card.pem ec2-user#10.205.75.204 rm -rf /home/ec2-user/testfile.txt
how can we achieve running mutiple commands like this?
Hey # Siraj Syed check following example:
String commandToRun = 'cat /home/ec2-user/testfile.txt; rm -rf /home/ec2-user/testfile.txt'
// pipeline step
sh "ssh -o StrictHostKeyChecking=no -i /home/ec2-user/card.pem ec2-user#10.205.75.204 /bin/bash -c '\"${commandToRun}\"'"
Can you just do:
ssh -o StrictHostKeyChecking=no -i /home/ec2-user/card.pem ec2-user#10.205.75.204 "cat /home/ec2-user/testfile.txt; rm -rf /home/ec2-user/testfile.txt"
When I am trying to use the below code in RStudio I am getting error.
Code:
system(paste("sshpass -v -f -N -o StrictHostKeyChecking=no -i '<Path>/id_rsa.ppk' -L 3306:localhost:3306 root#127.0.0.1 sleep 20"))
Warning:
running command 'sshpass -v -f -N -o StrictHostKeyChecking=no -i '<Path>/id_rsa.ppk' -L 3306:localhost:3306 root#127.0.0.1 sleep 20' had status 127
How can I resolve the above issue in R?
Running snort (in packet dump mode) with command sudo snort -C snort.conf -A console -i eth0 a following problem occurred:
--== Initializing Snort ==--
Initializing Output Plugins!
Snort BPF option: snort.conf
pcap DAQ configured to passive.
The DAQ version does not support reload.
Acquiring network traffic from "eth0".
ERROR: Can't set DAQ BPF filter to 'snort.conf' (pcap_daq_set_filter: pcap_compile: syntax error)!
Fatal Error, Quitting..
Can someone please suggest a solution?
You're using the wrong option to load the configuration, it should be the lower case '-c'.
sudo snort -c snort.conf -A console -i eth0
Also, you can test your configuration with '-T' before running it:
sudo snort -T -c snort.conf
just put "-i" before eth0 in command it will solve the problem
Try this:
sudo service snort
ps ax|grep snortstart
The output I got was
/usr/sbin/snort -m 027 -D -d -l /var/log/snort -u snort -g snort -c
/etc/snort/snort.conf -S HOME_NET=[192.168.0.0/16] -i enp4s0
The man page says
-D Run Snort in daemon mode. Alerts are sent to
/var/log/snort/alert unless otherwise specified.
So when I drop the -D and add the -A
sudo /usr/sbin/snort -m 027 -d -l /var/log/snort -u snort -g snort -c /etc/snort/snort.conf -S HOME_NET=[192.168.0.0/16] -i enp4s0 -A console
Works for snort Version 2.9.7.0 GRE (Build 149)
What's wrong with this code?
sudo -u replicant rsync -av -e "ssh -o 'StrictHostKeyChecking no' -i /home/replicant/.ssh/id_rsa" --exclude 'media/' --exclude 'var/' --exclude '.svn' root#$ADMIN:/var/www/ /var/www/ &> /tmp/rsync if [ $? -ne 0 ]; then
echo "date: Error rsync'ing code base from $ADMIN check /tmp/rsync" | mail -s "Rsync error!" $DEVEMAIL
echo "date: Error rsync'ing code base from $ADMIN check /tmp/rsync" >> $LOGFILE
echo "root#$ADMIN:/var/www /var/www" >> $LOGFILE
exit
fi
I keep getting this error:
Permission denied (publickey).
rsync: connection unexpectedly closed (0 bytes received so far) [Receiver]
rsync error: unexplained error (code 255) at io.c(605)
[Receiver=3.0.9]
Please help. Thanks.
Try to login directly on SSH to fix your issues, then move on to your rsync test. So start with:
ssh -o 'StrictHostKeyChecking no' -i /home/replicant/.ssh/id_rsa root#$ADMIN
Sidenotes:
don't use root for such a task
add set -eu at the start of your Bash script, so that errors will end up your script and ease debugging (for example if $ADMIN is not defined, the script will end in error)