AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / ubuntu / 问题

问题[tar](ubuntu)

Martin Hope
kjekk
Asked: 2020-11-27 14:03:50 +0800 CST

如何调试涉及 netcat 的失败 cron 作业?

  • 0

在这个问题中提出了使用 crontab 在两台机器上调度 netcat 命令的想法,但受访者都指责提问者并scp转而谈论。

假设我对这些影响没问题,我将如何找出这个设置出了什么问题?出于测试目的,我在当地时间 13:45 同步这两个作业。两台计算机位于同一本地时区。

目标 crontab:

45 13 * * * nc -l -p 1234 > /path/to/backup-$(date +%F).tar.bz2

源 crontab:

45 13 * * * /path/to/backup_script.sh

源备份脚本:

sleep 5  # to ensure the destination is already listening
tar -cvpj --exclude-vcs /path/to/source/files | nc -N dest 1234

单独(在 crontab 之外),listen 命令和备份脚本工作。据我了解,目的地在收到 EOF 之前不会停止收听。然而,它的收听端似乎没有在应该收听的时候收听。我可以手动启动它,源的计划作业将发送文件,但我无法让目标在指定的时间收听。

scripts cron tar netcat
  • 2 个回答
  • 327 Views
Martin Hope
codechimp
Asked: 2020-11-20 14:44:36 +0800 CST

从 tar 文件中提取更新文件的特定版本

  • 1

我有一个 tar 文件,随着时间的推移已经更新(例如tar -uf backup.tar file.txt),具有特定文件的各种迭代(例如file.txt)。

如何提取文件的旧版本,而不是最新版本?

tar
  • 1 个回答
  • 57 Views
Martin Hope
Rob
Asked: 2020-10-17 17:19:40 +0800 CST

如何安装 xfe-1.43.2.tar.gz?

  • 1

我正在运行 Ubuntu 18.04.5 LTS 我安装了 xfe 文件管理器:sudo apt install xfe version 1.42。我想将它升级到版本 1.43.2。我下载了 xfe-1.43.2.tar.gz 并解压。我为我尝试在下面运行的文件授予了执行权限。我不知道我必须做什么才能执行升级?我已经尝试过了:我将路径更改为将其提取到的目录并运行:

rob@rob-MS-7721:~/Ub18/File-Mangers/xfe/xfe-1.43.2$ ./configure
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... no
checking for mawk... mawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking for style of include used by make... GNU
checking for gcc... gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ISO C89... none needed
checking whether gcc understands -c and -o together... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for gcc... (cached) gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether gcc accepts -g... (cached) yes
checking for gcc option to accept ISO C89... (cached) none needed
checking whether gcc understands -c and -o together... (cached) yes
checking dependency style of gcc... (cached) gcc3
checking for g++... g++
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking dependency style of g++... gcc3
checking whether ln -s works... yes
checking whether make sets $(MAKE)... (cached) yes
checking for pkg-config... no
checking whether NLS is requested... yes
./configure: line 6350: intltool-update: command not found
checking for intltool-update... no
checking for intltool-merge... no
checking for intltool-extract... no
configure: error: The intltool scripts were not found. Please install intltool.
rob@rob-MS-7721:~/Ub18/File-Mangers/xfe/xfe-1.43.2$ 

我注意到一些不,但认为它可能会安装?我猜想 intltool 代表我不需要的国际工具。

所以我跑了:安装并得到:

rob@rob-MS-7721:~/Ub18/File-Mangers/xfe/xfe-1.43.2$ ./INSTALL
./INSTALL: line 1: Installation: command not found
./INSTALL: line 2: ABOUT-NLS: command not found
./INSTALL: line 4: syntax error near unexpected token `C'
./INSTALL: line 4: `Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005 Free'
rob@rob-MS-7721:~/Ub18/File-Mangers/xfe/xfe-1.43.2$ 

跑 /autogensh 并得到:

rob@rob-MS-7721:~$ /home/rob/Ub18/File-Mangers/xfe/xfe-1.43.2/autogen.sh
/home/rob/Ub18/File-Mangers/xfe/xfe-1.43.2/autogen.sh: 7: /home/rob/Ub18/File-Mangers/xfe/xfe-1.43.2/autogen.sh: aclocal: not found
/home/rob/Ub18/File-Mangers/xfe/xfe-1.43.2/autogen.sh: 8: /home/rob/Ub18/File-Mangers/xfe/xfe-1.43.2/autogen.sh: autoconf: not found
/home/rob/Ub18/File-Mangers/xfe/xfe-1.43.2/autogen.sh: 9: /home/rob/Ub18/File-Mangers/xfe/xfe-1.43.2/autogen.sh: automake: not found
rob@rob-MS-7721:~$

我对 ltmain.sh 文件做了同样的事情,得到:

rob@rob-MS-7721:~/Ub18/File-Mangers/xfe/xfe-1.43.2$ /home/rob/Ub18/File-Mangers/xfe/xfe-1.43.2/ltmain.sh
/bin/bash: warning: shell level (1000) too high, resetting to 1
It repeated the above several times and a whole bunch of other errors before I canceled it.
rob@rob-MS-7721:~/Ub18/File-Mangers/xfe/xfe-1.43.2$

没有其他 .sh 文件,我不知道要运行哪些其他可执行文件,或者如果我这样做了我需要给他们什么信息。我不知道从这里去哪里。如何安装下载的 xfe-1.43.2.tar.gz?谢谢,罗伯

upgrade bash gzip tar
  • 1 个回答
  • 123 Views
Martin Hope
Rychu
Asked: 2020-08-09 02:52:26 +0800 CST

TAR `--listed-incremental` 始终是 ZFS(和 Ubuntu)升级后的完整备份

  • 0

TL;博士

在将我的 ZFS 池从 0.7.x 升级到 0.8.3(以及 Ubuntu 从 18.04.x 升级到 20.04.1)之后,我的 Nextcloud 数据备份(几乎)始终是完整备份。在升级之前,一切都很好,加上我的另一个系统 rpool 的行为符合预期。

真实的故事

我配置了两个 TAR 备份。系统备份,现在一切都很好,Nextcloud 数据备份,也很好,但现在不行了。它在 ZFS 0.7.x 和 Ubuntu 18.04.x 上运行了一年多。前段时间我迁移到 Ubuntu 20.04,然后是 20.04.1,自从第一次升级以来,Nextcloud 备份一直(几乎)一直是完整备份。就像十分之一一样,它会按预期进行增量备份,但不幸的是,它更像是一个小故障而不是规则。

果汁

我的备份没什么特别的:

tar -cpz \
    --listed-incremental="$backupIncrementalMetadataFullFileName" \
    --exclude="$backupLocation" \
    --exclude="*RychuSrv*Backup*.*" \
    "/srv/nextcloud/${nextcloudFolderName}" \
        | tee "$tarBackupFullFileName" \
        | gpg [censored]

ZFS 发生了吗?

我将注意力集中在 ZFS 上,因为……还有什么?:) 但我不知道是什么导致了这种情况发生。我尝试将我的行为rpool与 Nextcloud 的行为进行比较,除了日期或指南等明显差异外,我没有发现任何有意义的东西。具有不同值的属性是:

  • 设备
  • 创建txg
  • 自动修剪(rpool是 SSD)
  • canmount(备份的 hason和rpool's has noauto)

我知道可能对问题产生影响的其他功能/属性是atime,realtime并且两个池都是on.

文件看起来如何

因此,备份的主要是文件夹中的图像和视频文件,其中大多数文件已经很长时间没有更改。例如:

# ls -1l . | tail -n 500 | head -n 10
-rw-r--r-- 1 www-data www-data    2113359 Jan  5  2020 IMG_20200105_172639.jpg
-rw-r--r-- 1 www-data www-data    2029782 Jan  5  2020 IMG_20200105_172641.jpg
-rw-r--r-- 1 www-data www-data    2374428 Jan  5  2020 IMG_20200105_172652.jpg
-rw-r--r-- 1 www-data www-data    2523738 Jan  5  2020 IMG_20200105_172654.jpg
-rw-r--r-- 1 www-data www-data    3405077 Jan  6  2020 IMG_20200106_083530.jpg
-rw-r--r-- 1 www-data www-data    1989491 Jan  6  2020 IMG_20200106_183744.jpg
-rw-r--r-- 1 www-data www-data    2220897 Jan 11  2020 IMG_20200111_131056.jpg
-rw-r--r-- 1 www-data www-data    2850718 Jan 11  2020 IMG_20200111_132928.jpg
-rw-r--r-- 1 www-data www-data    2095188 Jan 11  2020 IMG_20200111_132956.jpg
-rw-r--r-- 1 www-data www-data    2312352 Jan 11  2020 IMG_20200111_133414.jpg

# stat IMG_20200111_131056.jpg
  File: IMG_20200111_131056.jpg
  Size: 2220897         Blocks: 4369       IO Block: 131072 regular file
Device: 43h/67d Inode: 328087      Links: 1
Access: (0644/-rw-r--r--)  Uid: (   33/www-data)   Gid: (   33/www-data)
Access: 2020-08-05 00:16:30.136312800 +0200
Modify: 2020-01-11 13:10:57.000000000 +0100
Change: 2020-01-13 14:36:14.531413322 +0100
 Birth: -

您可以看到文件在午夜之后被访问,这意味着备份脚本将其拉入备份。

为什么?该文件已在 6 个月前更改!

PS。我刚刚注意到访问时间有不同的时区。这不是很奇怪吗??

upgrade backup tar zfs
  • 1 个回答
  • 281 Views
Martin Hope
alper
Asked: 2020-07-08 06:02:55 +0800 CST

tar:p:无法打开:没有这样的文件或目录

  • 0

我在file.tar.gz 文件所在的目录中。我想umask通过使用该-p (--preserve)选项来忽略。但我无法用-p标志解压它。可能是什么原因?

  • tar -xvfp file.tar.gz# 不起作用
  • tar -xvf file.tar.gz # 当我删除p它的时候
$ ls *file.tar.gz
file.tar.gz

$ tar -xvfp file.tar.gz
tar: p: Cannot open: No such file or directory
tar: Error is not recoverable: exiting now

$ tar -xvf file.tar.gz
file.txt
tar
  • 2 个回答
  • 1884 Views
Martin Hope
Bharadwaj Poduri
Asked: 2020-06-10 00:33:41 +0800 CST

每次运行二进制文件时都会安装软件吗?

  • 1

所以我的怀疑可能听起来很有趣,但我对 ubuntu 有点陌生,想清楚地了解安装 .deb、.rpm、tarball 等软件的不同方法。所以考虑到 tarball 的情况。在某些情况下,当我下载一个 tarball 并解压缩它时,我找不到 ./configure 文件,然后通过谷歌搜索我了解到我们需要在 bin 文件中运行二进制文件,因为提取的文件夹包含二进制文件。所以我的问题是每次我运行二进制文件时都会安装软件吗?谁能解释这是如何工作的?

software-installation package-management software-center tar binary
  • 1 个回答
  • 85 Views
Martin Hope
Rudi
Asked: 2020-06-09 22:51:57 +0800 CST

最终检查更改的目录的 tar

  • 1

有没有办法使用 tar 打包目录并在去皮后检查源数据是否有变化?

好吧,我想打包一个文件夹。但是在打包过程中可能会更改文件夹的内容。我需要一种 tar 方法来检查创建存档后源文件是否已更改。如果是这样,打包的文件应该被新的源文件覆盖

ext4 tar 18.04
  • 2 个回答
  • 184 Views
Martin Hope
dashthird
Asked: 2020-05-12 09:24:24 +0800 CST

压缩文件大小不一致

  • 0

我试图将文件夹压缩为 .tar 格式。

文件夹大小约为 76 MB。

假设我想将文件夹压缩myfolder为my-compressed-folder(tar格式)

我尝试了两种方法:

1)在终端中,我执行了:

tar -cjvf my-compressed-folder myfolder

此方法的.tar 大小为 23 MB

Compress2)在右键单击myfolder并选择.tar.xz后使用内置,.tar 的大小约为 17 MB。

我有两个疑问:

1) 相同 (.tar) 格式的 2 个压缩文件的大小差异为何如此之大?

Compress2) 是否有任何 Linux 命令可以创建压缩比与Ubuntu内置功能相同的压缩 .tar 文件?

我的系统详细信息如下:

Ubuntu Desktop
Version 18.04.4 LTS (64-bit)
command-line compression tar
  • 1 个回答
  • 180 Views
Martin Hope
Werner Raath
Asked: 2020-04-22 23:26:09 +0800 CST

压缩任何符号链接后的文件夹

  • 0

我将大量数据存储在一个平面结构中,并创建指向不同文件夹的符号链接,我的客户可以通过 OwnCloud 访问它们。

我需要压缩其中一个包含符号链接的文件夹并通过 ftp 将其发送给客户端,但我根本无法让我的压缩器跟随我的符号链接。

例如,data.tar从文件夹创建文件,符号链接/data在哪里,因此我需要是压缩成的文件/data/a.txt/home/data/a.txt/home/data/a.txtdata.tar

我怎样才能做到这一点?

ftp gzip compression tar symbolic-link
  • 2 个回答
  • 181 Views
Martin Hope
Arun
Asked: 2020-03-05 21:54:45 +0800 CST

tar -tf 与 tar -tzf 之间的区别

  • 2

我正在尝试列出 tar 文件的内容。我通过结合看到了这一点-t,-f我可以这样做。它似乎甚至适用于压缩档案。

-z另外与的组合-tf似乎也给出了相同的结果。这是否意味着-z在这种情况下没有效果或效果存在但不可观察。

我是菜鸟。因此,如果我的问题中有任何错误,请原谅。

compression tar
  • 1 个回答
  • 1776 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    如何运行 .sh 脚本?

    • 16 个回答
  • Marko Smith

    如何安装 .tar.gz(或 .tar.bz2)文件?

    • 14 个回答
  • Marko Smith

    如何列出所有已安装的软件包

    • 24 个回答
  • Marko Smith

    无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗?

    • 25 个回答
  • Martin Hope
    Flimm 如何在没有 sudo 的情况下使用 docker? 2014-06-07 00:17:43 +0800 CST
  • Martin Hope
    Ivan 如何列出所有已安装的软件包 2010-12-17 18:08:49 +0800 CST
  • Martin Hope
    La Ode Adam Saputra 无法锁定管理目录 (/var/lib/dpkg/) 是另一个进程在使用它吗? 2010-11-30 18:12:48 +0800 CST
  • Martin Hope
    David Barry 如何从命令行确定目录(文件夹)的总大小? 2010-08-06 10:20:23 +0800 CST
  • Martin Hope
    jfoucher “以下软件包已被保留:”为什么以及如何解决? 2010-08-01 13:59:22 +0800 CST
  • Martin Hope
    David Ashford 如何删除 PPA? 2010-07-30 01:09:42 +0800 CST

热门标签

10.10 10.04 gnome networking server command-line package-management software-recommendation sound xorg

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve