Why can't `-C /` be used in a separate file when invoking tar?
I am trying to use tar to archive some files and send them to a remote server over ssh. I want to specify the files to archive in a separate file using the
-T option. The following command does not work.
$ tar -cf - -T files | ssh servo "cat > myarchive.tar"
-C / etc/
The error I get back is
tar: files:1: unrecognized option tar: etc: Cannot stat: No such file or directory tar: Exiting with failure status due to previous errors
If I instead define files as
-C /etc X11/
and then run the same command, I get the desired result of creating an archive on the remote server.
When I specify
-C / directly as an argument to tar and not in files, I also get the desired result.
Why can't I specify
-C / in files?
Edit: Using GNU tar version 1.34
do you know?
how many words do you know
See also questions close to this topic
Apache Server is very slow on Sunday morning, CentOS, Tomcat
I've created the Java Spring Boot app and deployed it on the Tomcat, in the Apache VPS server. The operating system is Linux CentOS 7. My app is working great, but only on Sunday, around 02:00 am UTC + 1 until 12:00 am UTC + 1 pages are loaded extremely slow. Not only pages of my app, but also PHPMyAdmin, and Linux terminal. And only at that time. Last night, slowing started on Sunday at 07:00 am. I don't have much knowledge about this topic, I will be very grateful if you can help me, or at least to guide me in the right direction.
I've first tried to see my MySQL slow log file, I've had a few slow queries but at 7:30 (the employees experienced huge lags at 7:00). Also, the same queries are not slow on any other day, so the problem is probably not because of the queries.
In my Apache error log I've found three types of strange errors (I'll censor the actual addresses):
[Sun Nov 28 07:04:10.585796 2021] [proxy_http:error] [pid 27425] (20014)Internal error: [client (ip address of the client)] AH01102: error reading status line from remote server my server:8080, referer: http://my_server/money_table/money_table [18:61976] AH00898: Error reading from remote server returned by /money_table/money_table, referer: http://my_server/money_table/money_table
This error happens multiple times for different pages.
In another error log file I've got:
[Sun Nov 28 05:39:07.745375 2021] [autoindex:error] [pid 8543] [client (ip of client)] AH01276: Cannot serve directory /var/www/html/: No matching DirectoryIndex (index.html,index.php) found, and server-generated directory index forbidden by Options directive [Sun Nov 28 05:42:04.966887 2021] [php7:error] [pid 28141] [client (ip of client)] script '/var/www/html/wp-login.php' not found or unable to stat.
I don't know why it is mentioned wp-login.php because I didn't use WordPress at all.
The hosting provider stated that everything is alright with their services.
Does this have something about the application or about the server? I think that, if the application is wrong, the error will repeat every day not only on Sunday midnight and morning (employees are doing the same job each day).
Grep function inaccurate or bad command?
Hi I am using grep command in windows WSL and it seems to be inaccurate
the command is to remove matching lines from file1 from file2 and output of those lines in file3 (textfiles)
grep -v -f file2.txt file1.txt >> file3.txt
however the output doesnt add up to the total lines, file2 may have 100 lines, and file1 may have 50 and the output file3 may have 30 lines for example. but my scale is larger file2 has 430,000 lines and file1 has 30,000 but the output has 370,000. Also to know, every line from file 1 matches in file 2 just randomly mixed in there so I have to use grep to remove them. Also, there are no duplicate lines in neither file1 or file2 Thank you for any answers or help have a good night
ldd shows .so not found but RUNPATH contains the lib
I'm trying to get some binaries running on NixOS, and I ran into a weird situation when trying to get
libpython2.7.so.1.0and other libs.
$ ldd lldb ./lldb: /nix/store/5rjfisjzz6vgwmgf7zx25yd9p6rfs0zy-ncurses-6.2-abi5-compat/lib/libtinfo.so.5: no version information available (required by ./lldb) ./lldb: /nix/store/5rjfisjzz6vgwmgf7zx25yd9p6rfs0zy-ncurses-6.2-abi5-compat/lib/libtinfo.so.5: no version information available (required by /nix/store/nn8pr7xzam0rz7fq95x9dpi087xazsnv-theos/share/theos/toolchain/linux/iphone/usr/bin/./../lib/liblldb.so.10git) linux-vdso.so.1 (0x00007ffd57b80000) libpthread.so.0 => /nix/store/z56jcx3j1gfyk4sv7g8iaan0ssbdkhz1-glibc-2.33-56/lib/libpthread.so.0 (0x00007f921e821000) liblldb.so.10git => /nix/store/nn8pr7xzam0rz7fq95x9dpi087xazsnv-theos/share/theos/toolchain/linux/iphone/usr/bin/./../lib/liblldb.so.10git (0x00007f9215c3c000) libz.so.1 => /nix/store/1l4r0r4ab3v3a3ppir4jwiah3icalk9d-zlib-1.2.11/lib/libz.so.1 (0x00007f9215c1f000) librt.so.1 => /nix/store/z56jcx3j1gfyk4sv7g8iaan0ssbdkhz1-glibc-2.33-56/lib/librt.so.1 (0x00007f9215c12000) libdl.so.2 => /nix/store/z56jcx3j1gfyk4sv7g8iaan0ssbdkhz1-glibc-2.33-56/lib/libdl.so.2 (0x00007f9215c0d000) libtinfo.so.5 => /nix/store/5rjfisjzz6vgwmgf7zx25yd9p6rfs0zy-ncurses-6.2-abi5-compat/lib/libtinfo.so.5 (0x00007f9215ba7000) libm.so.6 => /nix/store/z56jcx3j1gfyk4sv7g8iaan0ssbdkhz1-glibc-2.33-56/lib/libm.so.6 (0x00007f9215a66000) libstdc++.so.6 => /nix/store/c9f15p1kwm0mw5p13wsnvd1ixrhbhb12-gcc-10.3.0-lib/lib/libstdc++.so.6 (0x00007f9215891000) libgcc_s.so.1 => /nix/store/c9f15p1kwm0mw5p13wsnvd1ixrhbhb12-gcc-10.3.0-lib/lib/libgcc_s.so.1 (0x00007f9215875000) libc.so.6 => /nix/store/z56jcx3j1gfyk4sv7g8iaan0ssbdkhz1-glibc-2.33-56/lib/libc.so.6 (0x00007f92156b0000) /nix/store/z56jcx3j1gfyk4sv7g8iaan0ssbdkhz1-glibc-2.33-56/lib/ld-linux-x86-64.so.2 => /nix/store/z56jcx3j1gfyk4sv7g8iaan0ssbdkhz1-glibc-2.33-56/lib64/ld-linux-x86-64.so.2 (0x00007f921e843000) libpython2.7.so.1.0 => not found libncurses.so.5 => not found libform.so.5 => not found libpanel.so.5 => not found libuuid.so.1 => not found libedit.so.2 => not found libxml2.so.2 => not found
There are quite a few missing, but let's focus on
libpython2.7.so.1.0. When we check the
$ readelf -d ld64 | rg RUNPATH 0x000000000000001d (RUNPATH) Library runpath: [/nix/store/c9f15p1kwm0mw5p13wsnvd1ixrhbhb12-gcc-10.3.0-lib/lib:/nix/store/z56jcx3j1gfyk4sv7g8iaan0ssbdkhz1-glibc-2.33-56/lib:/nix/store/xvyzi7cr0icnyavi5pm9rywjc4d8l7sx-libedit-20210714-3.1/lib:/nix/store/yxflij8cg4fgnzqmda91jx4d94jvkjf5-util-linux-2.37.2-lib/lib:/nix/store/370lxynzkmwrk8685jx9p2vgh7h0xp2h-libxml2-2.9.12/lib:/nix/store/5rjfisjzz6vgwmgf7zx25yd9p6rfs0zy-ncurses-6.2-abi5-compat/lib:/nix/store/nvx0l614cv661i5zz6w3j3y2w1xzppv1-python-2.7.18/lib:/nix/store/7344a20iqaja6i2qdz2xrgzy28rgnz5p-util-linux-2.37.2-lib/lib:/nix/store/1l4r0r4ab3v3a3ppir4jwiah3icalk9d-zlib-1.2.11/lib:$ORIGIN/../lib]
/nix/store/nvx0l614cv661i5zz6w3j3y2w1xzppv1-python-2.7.18/lib, which has our desired lib,
$ file /nix/store/nvx0l614cv661i5zz6w3j3y2w1xzppv1-python-2.7.18/lib/libpython2.7.so.1.0 /nix/store/nvx0l614cv661i5zz6w3j3y2w1xzppv1-python-2.7.18/lib/libpython2.7.so.1.0: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, not stripped
I'm not sure how this is possible. The executable is also 64-bit, as we can see here:
$ file lldb lldb: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /nix/store/z56jcx3j1gfyk4sv7g8iaan0ssbdkhz1-glibc-2.33-56/lib/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, not stripped
Why is my "tar"-command not working because it is refusing to create an empty archive?
tar: Cowardly refusing to create an empty archive Try 'tar --help' or 'tar --usage' for more information.
And these are my Commands:
tar -cz -newer $letztes_full_backup -f $zielpfad/inc_backup_home_$datum.tar.gz/home tar -czf $zielpfad/full_backup_$datum.tar.gz/home tar -czf $zielpfad/full_backup_$datum.tar.gz/home
Ubuntu 20.04 folder/path: Not a directory
I'm trying to unarchive a file from aws-dump folder. When I try to cd to it it gives me the following error:
First step (install databse dump from AWS S3):
aws s3 cp s3://server-mongo-backup/backup.tar.gz aws-dump
cd aws-dump -bash: cd: aws-dump: Not a directory // this is the error
Even the color of the aws-dump is different (white) comparing to others:
I need then to extract the backup.tar.gz from extracted directory:
tar -xzvf /aws-dump/backup.tar.gz -C /aws-extracted/
The code above shows this error:
Thank you mates in advance!
Why tar- archiving loaded a source- disk, and not receiver- disk?
On Windows 10 I have two partitions C (on slow HDD) and D (on fast SSD). When I archive a folder with files, located on a slow disk C, to the archive, located on the fast disk D, then the task manager shows that always fully loaded the C disk and always zero loaded the D disk. Therefore, archiving operations are performed very slowly.
tar = tarfile.open('D:\\Archive.tar.gz', "w:gz") for txt_file in glob.glob('C:\\BigFolder\\*.txt'): if need_exit(): completed_archive = False break tar.add(txt_file) tar.close()
It seems that all interim archive creation operations execute on the C disk. At the same time, I have already transferred temporary files and pagefile.sys to the D disk:
>>> import tempfile >>> tempfile.gettempdir() 'D:\\tmp'
How to transfer the load from the C disk to the D disk?