rsync command fails with jenkin - shell

While am trying to execute rsync command from macOS Catalina terminal i was able to successfully copy the data from volume to local drive
This is the command am using
rsync -avxhPE /Volumes/pathtofolder/assets/. ./assets
But the same command is not working in Jenkins. Am getting the following error.
+ rsync -avxhPE /Volumes/pathtofolder/assets/. ./assets
19:28:22 building file list ...
19:28:24 0 files...
rsync: opendir "/Volumes/pathtofolder/assets/." failed: Operation not permitted (1)
19:28:24 1 file to consider
19:28:24 ./
19:28:24
19:28:24 sent 83 bytes received 26 bytes 43.60 bytes/sec
19:28:24 total size is 0 speedup is 0.00
19:28:24 rsync error: some files could not be transferred (code 23) at /BuildRoot/Library/Caches/com.apple.xbs/Sources/rsync/rsync-54/rsync/main.c(996) [sender=2.6.9]
19:28:24 Build step 'Execute shell' marked build as failure
19:28:24 Finished: FAILURE

The user who run jenkins do not have permission to read the directory. Check this line:
rsync: opendir "/Volumes/pathtofolder/assets/." failed: Operation not permitted (1)

This is a consequence of new user privacy protections in macOS 10.15. See WWDC 2019 Session 701 Advances in macOS Security for all the details. As a user, you can grant access to the tool by adding it to the list in
System Preferences > Security & Privacy > Privacy > Files and Folders.
Share and Enjoy

Related

Squid failed to make swap directory

I am currently trying to setup Squid proxy for caching purposes on a server running Ubuntu 20.04 but it fails to start with the following errors:
2021/03/28 15:37:38| Created PID file (/var/run/squid.pid)
2021/03/28 15:37:38 kid1| Set Current Directory to /mnt/Biggy/squid
2021/03/28 15:37:38 kid1| Creating missing swap directories
2021/03/28 15:37:38 kid1| Not currently OK to rewrite swap log.
2021/03/28 15:37:38 kid1| storeDirWriteCleanLogs: Operation aborted.
2021/03/28 15:37:38 kid1| FATAL: Failed to make swap directory /mnt/Biggy/squid: (13) Permission denied
2021/03/28 15:37:38 kid1| Squid Cache (Version 4.10): Terminated abnormally.
The said folder was given correct ownership and permission:
drwxrwxr-x 2 proxy proxy 4096 Mar 28 14:50 squid
The relevant directives in squid.conf are below:
cache_store_log /mnt/Biggy/squid/store.log
coredump_dir /mnt/Biggy/squid
cache_dir ufs /mnt/Biggy/squid 10000 16 256
cache_effective_user proxy
cache_effective_group proxy
I checked user, group, permissions, etc all seem correct. There however another important point: if I change cache_effective_user to my own username and take ownership of the folder /mnt/Biggy/squid/ then it works. I would however prefer not to to that.
Does anyone have a suggestion? I don't mind deleting the /mnt/Biggy/squid/ folder if needed but it has to be stored on /mnt/Biggy.
Thank you

initdb for postgresql on os x fails

Having trouble installing postgres 10 on my Mac, version 10.12.5.
I've tried installing 2 ways:
(1) Downloading Postgres.app
(2) `brew install postgresql`
and tried to manually run a bunch of variations of these commands for initdb:
$ initdb /Applications/Postgres.app/Contents/Versions/latest/bin/ver-10
$ initdb /usr/local/var/postgres -E utf8
All yield the same error FATAL: could not create semaphores: Invalid argument.
Full trace:
The files belonging to this database system will be owned by user "foo".
This user must also own the server process.
The database cluster will be initialized with locale "en_US.UTF-8".
The default text search configuration will be set to "english".
Data page checksums are disabled.
fixing permissions on existing directory /usr/local/var/postgres ... ok
creating subdirectories ... ok
selecting default max_connections ... 10
selecting default shared_buffers ... 400kB
selecting dynamic shared memory implementation ... posix
creating configuration files ... ok
running bootstrap script ... 2018-03-12 20:49:58.654 PDT [98144] FATAL: could not create semaphores: Invalid argument
2018-03-12 20:49:58.654 PDT [98144] DETAIL: Failed system call was semget(1, 17, 03600).
child process exited with exit code 1
initdb: removing contents of data directory "/usr/local/var/postgres"
I'm not sure what FATAL: could not create semaphores: Invalid argument means. I've seen a lot of other answers related to insufficient space, but not this one.
Thanks in advance!
I had to remove Postgres which I install via Brew, and then I reinstalled Postgres.app, and then restarted my computer, and then opening the app and clicking 'initialize' fixed it.

How to overcome Centos to QNAP strange FTP file size limit of 150114776 bytes?

I'm sure there is a simple explanation but I cannot seem to figure it out. I have a Centos server which needs to do a daily FTP upload of a database to external back-up provided by a QNAP NAS. The server also puts a copy of the DB on to a second Centos server. The file is >800MB and growing.
I have a script which handles the FTP put of the file to the second server and this is called by crontab daily and works every time.
I have an almost identical script also called by crontab for the FTP to the QNAP and it always truncates the file at exactly 150114776 bytes. Strangely, if I run this same script from the CLI it always works perfectly delivering the entire file to the QNAP which suggests that there is no QNAP limit on filesize coming in to play.
The problem is consistent. Invoke the transfer with crontab and the file is truncated. Invoke with CLI and the whole file is transferred. No error is ever reported; FTP thinks it has done the whole job.
Sample log of transfer by crontab:
Connected to 172.172.1.1 (172.172.1.1).
220 NASFTPD Turbo station 1.3.4e Server (ProFTPD) [::ffff:172.172.1.1]
Remote system type is UNIX.
Using binary mode to transfer files.
331 Password required for fred
230 User fred logged in
250 CWD command successful
local: DATA_bk.sql.1.gz remote: DATA_bk_20150811_071501.sql.gz
227 Entering Passive Mode (172,172,1.1,217,232).
150 Opening BINARY mode data connection for DATA_bk_20150811_071501.sql.gz
226 Transfer complete
150114776 bytes sent in 23 secs (6.4e+03 Kbytes/sec)
221 Goodbye.
And a manual invocation:
Connected to 172.172.1.1 (172.172.1.1).
220 NASFTPD Turbo station 1.3.4e Server (ProFTPD) [::ffff:172.172.1.1]
Remote system type is UNIX.
Using binary mode to transfer files.
331 Password required for fred
230 User fred logged in
250 CWD command successful
local: DATA_bk.sql.1.gz remote: DATA_bk_20150811_120117.sql.gz
227 Entering Passive Mode (172,172,1.1,217,189).
150 Opening BINARY mode data connection for DATA_bk_20150811_120117.sql.gz
226 Transfer complete
879067272 bytes sent in 182 secs (4.5e+03 Kbytes/sec)
221 Goodbye.
Can anyone point me to some rule I've overlooked or suggest a way to debug this?
Thanks
It turns out I made a simple error. The cron tab was executing in the wrong directory where there happened to be an old copy of the source file which just happened to be 150114776 bytes big. Some times, the simplest causes are the toughest to see.
Data transfer to the QNAP now works perfectly every time.
We have the same problem. We opened a ticket with QNAP and this is the reply:
This a known issue (bug) what you can do is downgrade to the former firmware version or wait to the next one
is released where hopefully this issue is solved.
Sorry for the inconvenience.
So.... downgrade or wait...

Error with cwRsync on Windows 8

I've installed cwRsync on my Windows 8 machine and tried to rsync files to remote server with the following command:
rsync rev/ user#ip:~/.tmp --rsh ssh --recursive --delete --delete-excluded --verbose
But get 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(605) [Receiver=3.0.9]
rsync: read error: Connection reset by peer (104)
rsync error: error in rsync protocol data stream (code 12) at io.c(759) [sender=3.0.6]
Does anybody faced with the error above and what could be reason?
Seems that you need to run this command as admin. Open your cmd as administartor and run again.

FTP Move / Rename / Copy files between directories

I have a /ABC folder with files. I need to move them to parent folder.
Example: In the Apache /htdocs/backup/ folder I have files. I want to quickly move/copy them into /htdocs
I am using Total Commander FTP and also ISP (Network Solutions) online FTP manager.
Both will not move the file.
TC will bailout with:
Remote transfer failed - probably NOT
supported by server!
Looking at the Total Commander FTP log trying to perform RETR and STOR - Transfer a copy of the file, and going back to the supported features FTP server's response:
FEAT
211-Features:
EPRT
EPSV
MDTM
PASV
REST STREAM
SIZE
TVFS
UTF8
211 End
I see that those commands are not supported:
200 PORT command successful. Consider using PASV.
RETR 404.html
150 Opening BINARY mode data connection for 404.html (12474 bytes).
1:STOR 404.html
1:425 Failed to establish connection.
Result:
TC cannot move files between folders
(the second window does not allow to
display the same connection - but it
makes new one - I don't know if this
has some effect)
Netsol File Manager does not allow
to move files to parent folder. I
tried multiple ways to name the
parent folder in the bottom input
field without success

Resources