I have a simple ansible playbook by which i want to rsync folders from target machines onto my ansible host.
---
- hosts: testServers
sudo: yes
gather_facts: yes
tasks:
- synchronize: mode=pull src=/home/prod/live-tpb/log/ dest=/root/playbooks/backup_live_folders/logs/{{ ansible_hostname }}
but when i run this playbook, it errors out saying
rsync: --out-format=<>%i %n%L: unknown option
The full error generated using the -vvvv option is as below.
failed: [192.168.101.174 -> 127.0.0.1] => {"cmd": "rsync --delay-updates -FF --compress --archive --rsh 'ssh -S none -o StrictHostKeyChecking=no' --rsync-path=\"sudo rsync\" --out-format='<<CHANGED>>%i %n%L' \"ansible#192.168.101.174:/home/prod/live-tpb/log/\" \"/root/playbooks/backup_live_folders/logs/serverC6174\"", "failed": true, "rc": 1}
msg: rsync: --out-format=<<CHANGED>>%i %n%L: unknown option
rsync error: syntax or usage error (code 1) at main.c(1231) [client=2.6.8]
When I run the command directly too this fails -
[root#server11 backup_live_folders]# rsync --delay-updates -FF --compress --archive --rsh 'ssh -S none -o StrictHostKeyChecking=no' --rsync-path="sudo rsync" --out-format='<<CHANGED>>%i %n%L' ansible#192.168.101.174:/home/prod/live-tpb/logs/ /root/playbooks/backup_live_folders/logs/serverC6174
rsync: --out-format=<<CHANGED>>%i %n%L: unknown option
rsync error: syntax or usage error (code 1) at main.c(1231) [client=2.6.8]
This looks like it is a problem with rsync on 14.04. My host machine is RHEL 5.4 and target machine is ubuntu 14.04.
How do i disable the --out-format option from ansible? Has anyone else faced similar problem? If yes, how to work around this issue?
Thanks
It was a problem of version. Upgrading rsync on source machine from v2.6.8 to v3.0.7 fixed the issue.
Apologies for the question.
Related
I'm trying to use nix on repl.it. I'm using static-nix from https://matthewbauer.us/blog/static-nix.html. If I run the following code:
mkdir -p "$HOME/.cache/nix/"
curl https://matthewbauer.us/nix > "$HOME/.cache/nix/nix.exe"
cat "$HOME/.cache/nix/nix.exe" | bash -s run --no-sandbox --store "$HOME/.cache/nix/store" -f channel:nixpkgs-unstable bash graphviz -c sh -c 'dot --help'
I get this error:
error: setting up a private mount namespace: Operation not permitted
I tried --no-sandbox, --option sandbox false and --option build-use-sandbox false, none of these have any effect on the error.
This is executed as non-root on a machine for which it is not possible for me to change kernel settings.
Here's a REPL reproducing the issue (it runs for a short while before displaying the error): https://repl.it/#suzannesoy/AgonizingWittyCoding#main.sh
Follow this document http://docs.sulu.io/en/latest/book/getting-started.html at the end of installation process I got this error:
Target: cache
cache:clear ({"--no-optional-warmers":true,"--no-debug":true,"--no-interaction":true})
// Clearing the admin cache for the dev environment with debug true
[Symfony\Component\Filesystem\Exception\IOException]
Failed to remove directory "/home/vagrant/Code/sulu/var/cache/admin/de~/doctrine": .
sulu:build [-D|--nodeps] [--destroy] [-h|--help] [-q|--quiet] [-v|vv|vvv|--verbose] [-V|--version] [--ansi] [--no-ansi] [-n|--no-interaction] [-s|--shell] [--process-isolation] [-e|--env ENV] [--no-debug] [--] <command> [<target>]
Before that I was trying to set up file permissions with this:
HTTPDUSER=`ps axo user,comm | grep -E '[a]pache|[h]ttpd|[_]www|[w]ww-data|[n]ginx' | grep -v root | head -1 | cut -d\ -f1`
sudo setfacl -R -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX var/cache var/logs var/uploads var/uploads/* web/uploads web/uploads/* var/indexes var/sessions
sudo setfacl -dR -m u:"$HTTPDUSER":rwX -m u:`whoami`:rwX var/cache var/logs var/uploads var/uploads/* web/uploads web/uploads/* var/indexes var/sessions
and also had these errors:
setfacl: web/uploads: Operation not supported
setfacl: web/uploads/media: Operation not supported
setfacl: web/uploads/media: Operation not supported
My host OS : Ubuntu 16.04
Vagrant : v.1.9.3
VirtualBox : v.5
Homestead: v.5.2.1
Does anyone have successful installation Sulu CMS with Homestead?
What is the option to solve these my issues?
Sulu CMS looks very promising but unfortunately I could not install it locally still with many attempts.
UPDATE
After comment of Daniel I've tried other way to install Sulu but again got error at the very end of installation:
Executing builders
==================
Target: cache
cache:clear ({"--no-optional-warmers":true,"--no-debug":true,"--no-interaction":true})
// Clearing the admin cache for the dev environment with debug true
[Symfony\Component\Filesystem\Exception\IOException]
Failed to remove directory "/home/vagrant/Code/sulu/app/cache/admin/de~/annotations": .
Opened test.app in browser I see this error:
Fatal error: Uncaught
Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function getLocale() on null in /home/vagrant/Code/sulu/vendor/sulu/sulu/src/Sulu/Bundle/WebsiteBundle/Twig/Content/ContentPathTwigExtension.php on line 70
Symfony\Component\Debug\Exception\FatalThrowableError: Call to a member function getLocale() on null in /home/vagrant/Code/sulu/vendor/sulu/sulu/src/Sulu/Bundle/WebsiteBundle/Twig/Content/ContentPathTwigExtension.php on line 70
Tried to delete cache folders manually - the same error.
All console commands work fine.
Any ideas?
P.S. I have a good experience of installation other Symfony-based applications under Homestead and all went smooth basically (Sylius, eZ etc.). So I am very surprised....
To get around this, you need to remove this folder from the host machine, because it's an artifact from the previous process of trying to set things up and it's in god-mode, created by a no-longer existing almighty entity.
vagrant destroy (needed to release filesystem locks)
Remove folder on host: rm -rf .../sulu/app/cache/admin
type: nfs on folder binding
vagrant up
Should work then, encountered this same problem recently.
If you're using Homestead Improved, use the built-in "sulu" project type for a decent Nginx auto-setup:
sites:
- map: homestead.app
to: /home/vagrant/Code/Project/web
type: sulu
I am currently testing rsync in order to synchronize some file between two servers.
When I espace the parameters of my command line with single quote, rsync seems to failed:
'rsync' '--recursive' '--verbose' '--archive' '--copy-dirlinks' '--rsh="ssh -i /path/to/my/key"' '--delete' '/path/to/my/source/directory' 'user#server:/path/to/my/destination/directory'
rsync: Failed to exec ssh -i /path/to/my/key: No such file or
directory (2) rsync error: error in IPC code (code 14) at pipe.c(85)
[sender=3.1.2] rsync: connection unexpectedly closed (0 bytes received
so far) [sender] rsync error: error in rsync protocol data stream
(code 12) at io.c(226) [sender=3.1.2]
But when I do not escape the parameters, rsync works correctly:
rsync --recursive --verbose --archive --copy-dirlinks --rsh="ssh -i /path/to/my/key" --delete /path/to/my/source/directory user#server:/path/to/my/destination/directory
I am using the 3.1.2 version.
I am doing something wrong ?
I would like to use rsync to synchronise my /rsync folder.
I create the rsync users on my 2 servers and configure the ssh key.
I installed rsync, created /rsync folder put chmod 777 on it.
But when I execute
rsync -avz -e ssh rsync#1.2.3.4:/rsync /rsync -p 8682
I have
Unexpected local arg: /rsync
If arg is a remote file/dir, prefix it with a colon (:).
rsync error: syntax or usage error (code 1) at main.c(1246) [Receiver=3.0.9]
("ssh rsync#1.2.3.4 -p 8682" works)
rsync -avz -e 'ssh -p 8682' rsync#1.2.3.4:/rsync /rsync
I am running rsync process as a daemon. Rsync tool does not accept --progress and --daemon options together. I thought to parse the /var/log/messages and rsyncd.log file, is it a correct approach ? Is there any other possibility to get the current progress of the synced data ?
Current usage of rsync -
rsync --daemon --config="/etc/rsyncd1.conf" --address=10.2.2.3
After adding --progress option
rsync -v --progress --daemon --config="/etc/rsyncd1.conf" --address=10.2.2.3
Starting rsync [10.2.2.3]: rsync: --progress: unknown option (in daemon mode)
(Type "rsync --daemon --help" for assistance with daemon mode.)
rsync error: syntax or usage error (code 1) at options.c(1005) [client=3.0.6]
[FAILED]
What about following workaround?
I've made a script, that calculates the whole rsync progress in Python. You could modify it to send needed info to syslog or whatever suits your needs and run it as daemon.