rsync: mkstemp failed: Permission denied (13) - sh

I am writing one shell script which have below command to copy the code files from remote server to local server by skipping some file but it gives errors like :
Command :
rsync -avz --delete --exclude=**/cache --exclude=**/administrator/cache/ --exclude=**/tmp --exclude=**/configuration.php -e ssh $REMOTE_USER#$REMOTE_SERVER:$REMOTE_PATH $LOCAL_PATH
Errors :
1) rsync: mkstemp "/var/www/test.domainname/public/.sript.php.4FRyfv" failed: Permission denied (13)
2) rsync: mkstemp "/var/www/test.domainname/public/.access.txt.PECuqA" failed: Permission denied (13)
3) rsync: failed to set times on "/var/www/test.domainname/public/administrator/components/com_bconnect": Operation not permitted (1)
administrator/components/com_bconnect/
4) rsync: mkstemp "/var/www/test.domainname/public/administrator/components/com_bconnect/.config.xml.8LWLWF" failed: Permission denied (13)
Can you please help me out for above 4 errors.

I've just come across this error in a different form, i.e. attempting to rsync to a nested directory in /var/www/html on a remote server and not having write permission to the /var/www/html directory itself. In my case my error turned out to be due to mangled rsync syntax, but in your case you probably don't have permission to write to /var/www. This is where rsync is attempting to create its temporary files.
From my understanding you have two options:
use the
--temp-dir
parameter
use the
--inplace
parameter.
This is explained in the rsync man page and has also been asked before.

This is basically a permission issue for the remote/local directory to/from which one invites the data. I solved this error in a slightly differenr form again! I was sending files from the local ubuntu machine to the remote ubuntu machine through this.
rsync -arvz -e 'ssh -p 64060' ./SE-D-20-00279R2.pdf yogender#<IP>:</path/to/destination>
I had the same permission error:
rsync: mkstemp "<path/of/the/file2/you/try/to/rsync>" failed: Permission denied (13)
....
....
....
rsync: mkstemp "<path/of/the/file2/you/try/to/rsync>" failed: Permission denied (13)
After fiddling around I find this solution:
Problem: the receiver doesn't know the permission with the sender
solution: Need to create the folder at the receiver side (big machine) with sudo.
sudo mkdir </path/to/directory/you/are/sending/file/to/remote/machine>
Give the permission to the folder, which will send the data to this directory:
sudo chown yogender </path/to/directory/you/are/sending/file/to/remote/machine>
yogender here is the admin or user. you can get it by doing "whoami" on remote machine (when you are sending data from local to remote)
Then simply:
rsync -zaP -e 'ssh -p 64060' ./SE-D-20-00279R2.pdf yogender#147.32.99.72:</path/to/directory/you/are/sending/file/to/remote/machine>>

Related

VS Code Remote ssh gives error when connecting to remote (cannot find the public key)

VS Code Remote ssh gives error when connecting to remote:
> no such identity: publickey.pem: No such file or directory Permission
> denied (publickey).
To avoid errors when public key is not found - a complete path to the key has to be given:
The same when using terminal:

windows to truenas backup through rsync

I am new to truenas. I want to backup a folder in windows PC to truenas server through cwrsync. when connecting to the truenas got the following error.
rsync: connection unexpectedly closed (0 bytes received so far) \[Receiver\]
rsync error: error in rsync protocol data stream (code 12) at io.c(226) \[Receiver=3.1.3\]
rsync: connection unexpectedly closed (0 bytes received so far) \[sender\]
rsync error: error in rsync protocol data stream (code 12) at io.c(228) \[sender=3.2.3\]
any thought on this?
enable the SSH in truenas server. and the command i used is,
rsync -v -a -H -h /cygdrive/c/work/ test#192.168.5.200:/mnt/test_path/test

could not access file "pg_wait_sampling": No such file or directory postgresql

after I use the following command then I cannot relogin postgresql
alter system set shared_preload_libraries = 'pg_wait_sampling';
exit trying login again. Then error happens. The following is error code:
2022-03-15 11:35:30.726 IST [975] FATAL: could not access file "pg_wait_sampling": No such file or directory
2022-03-15 11:35:30.727 IST [975] LOG: database system is shut down
pg_ctl: could not start server
Examine the log output.
postgresql version: 14.2. system: wsl ubuntu.
in conf file /etc/postgresql/14/main/postgresql.conf":
#shared_preload_libraries='' #(change requires restart)
According to PostgreSQL document alter command store in postgresql.auto.conf file.
You have to change this file and remove pg_wait_sampling form this file

ceph-mon[1437]: warning: unable to create /var/run/ceph: (13) Permission denied

I followed the ceph document manual install,and I use tarballs. The installation process went smoothly, but when I run start service display warning
Started Ceph cluster monitor daemon.
ceph-mon[1437]: warning: unable to create /var/run/ceph: (13) Permission denied
ceph-mon[1437]: 2018-08-15 12:21:08.625 7f04fa393180 -1 asok(0x55dee6e4c240) AdminSocketConfigObs::init: failed:
so, I run
chmod 775 -R /var/run/
After, ceph-mon service is normal, but when the system is rebooted, the warning appears again.
I tried to change /etc/ceph/ceph.conf. I added:
[client]
admin socket = /tmp/ceph/$cluster-$name.asok
But it didn't work. What should I do?
I solved this question
total two methods
1、modify ceph-mon#.service file,ceph replace root
ExecStart=/usr/bin/ceph-mon -f --cluster ${CLUSTER} --id %i --setuser root --setgroup root
or
2、modify ceph.conf file ,add
[mon]
run dir = XXXX (the path you want to use)
please trie:
chown ceph:ceph /var/run/ceph
You can check if the directory /var/run/ceph exists. If not, create a directory and give permission to your ceph user
sudo mkdir /var/run/ceph
sudo chown ceph:ceph /var/run/ceph

after lein ring server, I get error PSQLException no password was provided

I am naive in Postgres and clojure
I wanted to run this https://gitlab.com/dzaporozhets/clojure-picture-gallery
Install
git clone https://gitlab.com/clojure-code-examples/picture-gallery.git
cd picture-gallery
# Install dependencies
lein deps
# Create database
psql -c 'CREATE DATABASE gallery TEMPLATE template0'
Running
To start a web server for the application, run:
lein ring server
this is process I have to do.
1)) I had to git clone but git clone have not worked. they want to let me type id, password. like this:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
C:\Users\jiji>git clone https://gitlab.com/clojure-code-examples/picture-gallery
.git
Cloning into 'picture-gallery'...
Username for 'https://gitlab.com': ji
Password for 'https://ji#gitlab.com':
fatal: Authentication failed for 'https://gitlab.com/clojure-code-examples/pictu
re-gallery.git/'
C:\Users\jiji>
anyway I downloaded source from web and unzip this file
2) I have problem when I write psql -c 'CREATE DATABASE gallery TEMPLATE template0'. I use Windows 7. Though I installed postgresql, 'psql' instruction have not worked in cmd window. I don't know how I can use 'psql' instruction in window. anyway I make gallery database like this
3) and I write lein ring server in cmd window
but I got error like this:
C:\Users\jiji\clojureproject\clojure-picture-gallery-master>lein ring server
picture-gallery is starting
Exception in thread "main" org.postgresql.util.PSQLException: The server request
ed password-based authentication, but no password was provided., compiling:(C:\U
sers\jiji\AppData\Local\Temp\form-init366034846235691962.clj:1:105)
at clojure.lang.Compiler.load(Compiler.java:7142)
at clojure.lang.Compiler.loadFile(Compiler.java:7086)
at clojure.main$load_script.invoke(main.clj:274)
at clojure.main$init_opt.invoke(main.clj:279)
at clojure.main$initialize.invoke(main.clj:307)
at clojure.main$null_opt.invoke(main.clj:342)
at clojure.main$main.doInvoke(main.clj:420)
at clojure.lang.RestFn.invoke(RestFn.java:421)
at clojure.lang.Var.invoke(Var.java:383)
at clojure.lang.AFn.applyToHelper(AFn.java:156)
at clojure.lang.Var.applyTo(Var.java:700)
at clojure.main.main(main.java:37)
Caused by: org.postgresql.util.PSQLException: The server requested password-base
d authentication, but no password was provided.
at org.postgresql.core.v3.ConnectionFactoryImpl.doAuthentication(Connect
ionFactoryImpl.java:473)
at org.postgresql.core.v3.ConnectionFactoryImpl.openConnectionImpl(Conne
ctionFactoryImpl.java:203)
at org.postgresql.core.ConnectionFactory.openConnection(ConnectionFactor
y.java:65)
at org.postgresql.jdbc2.AbstractJdbc2Connection.<init>(AbstractJdbc2Conn
ection.java:146)
at org.postgresql.jdbc3.AbstractJdbc3Connection.<init>(AbstractJdbc3Conn
ection.java:35)
at org.postgresql.jdbc3g.AbstractJdbc3gConnection.<init>(AbstractJdbc3gC
onnection.java:22)
at org.postgresql.jdbc4.AbstractJdbc4Connection.<init>(AbstractJdbc4Conn
ection.java:47)
at org.postgresql.jdbc4.Jdbc4Connection.<init>(Jdbc4Connection.java:30)
at org.postgresql.Driver.makeConnection(Driver.java:414)
at org.postgresql.Driver.connect(Driver.java:282)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at clojure.java.jdbc$get_connection.invoke(jdbc.clj:177)
at clojure.java.jdbc$get_connection.invoke(jdbc.clj:161)
at clojure.java.jdbc$get_connection.invoke(jdbc.clj:164)
at clojure.java.jdbc$with_connection_STAR_.invoke(jdbc.clj:300)
at picture_gallery.models.schema$table_exists_QMARK_.invoke(schema.clj:2
8)
at picture_gallery.models.schema$migrate.invoke(schema.clj:35)
at picture_gallery.handler$init.invoke(handler.clj:18)
at clojure.lang.Var.invoke(Var.java:375)
at ring.server.standalone$serve.doInvoke(standalone.clj:93)
at clojure.lang.RestFn.invoke(RestFn.java:423)
at ring.server.leiningen$serve.invoke(leiningen.clj:20)
at user$eval6633.invoke(form-init366034846235691962.clj:1)
at clojure.lang.Compiler.eval(Compiler.java:6703)
at clojure.lang.Compiler.eval(Compiler.java:6693)
at clojure.lang.Compiler.load(Compiler.java:7130)
... 11 more
Subprocess failed
C:\Users\jiji\clojureproject\clojure-picture-gallery-master>
I guess it is password problem. but I don't know what it means
in short I have three question about 1)),2)),3)) why they are not worked?
answerto question 3)
take a look at /src/picture_gallery/models/db.clj here https://gitlab.com/dzaporozhets/clojure-picture-gallery/blob/master/src/picture_gallery/models/db.clj#L4
either set you DATABASE_URL environment variable to contain valid postgres connection url or just use
(def db (or (System/getenv "DATABASE_URL")
"postgresql://user:password#localhost:5432/gallery"))
replace user and password before #localhost with your postgres's user and password