tar

Read contents of .tar.gz file from website into a python 3.x object

老子叫甜甜 提交于 2019-12-01 07:12:30
问题 I am new to python. I can't figure out what I am doing wrong when trying to read the contents of .tar.gz file into python. The tarfile I would like to read is hosted at the following web address: ftp://ftp.ncbi.nlm.nih.gov/pub/pmc/b0/ac/Breast_Cancer_Res_2001_Nov_9_3(1)_61-65.tar.gz more info on file at this site (just so you can trust contents) http://www.pubmedcentral.nih.gov/utils/oa/oa.fcgi?id=PMC13901 The tarfile contains .pdf and .nxml copies of the journal article. And also a couple of

How to untar file in node.js

こ雲淡風輕ζ 提交于 2019-12-01 06:07:10
There are some untar libraries, but I cannot get them working. My idea would be something like untar(bufferStreamOrFilePath).extractToDirectory("/path", function(err){}) Is something like this available? Just an update on this answer, instead of node-tar , consider using tar-fs which yields a significant performance boost, as well as a neater interface. var tarFile = 'my-other-tarball.tar'; var target = './my-other-directory'; // extracting a directory fs.createReadStream(tarFile).pipe(tar.extract(target)); The tar-stream module is a pretty good one: var tar = require('tar-stream') var extract

How to untar file in node.js

独自空忆成欢 提交于 2019-12-01 04:06:32
问题 There are some untar libraries, but I cannot get them working. My idea would be something like untar(bufferStreamOrFilePath).extractToDirectory("/path", function(err){}) Is something like this available? 回答1: Just an update on this answer, instead of node-tar , consider using tar-fs which yields a significant performance boost, as well as a neater interface. var tarFile = 'my-other-tarball.tar'; var target = './my-other-directory'; // extracting a directory fs.createReadStream(tarFile).pipe

centos使用rsync异地备份

爱⌒轻易说出口 提交于 2019-12-01 03:44:58
介绍 本文提供了一种快速的方法来备份最常见的事情在一个典型的Web主机情形:网站文件和数据库中的数据。我们将设置一个网站的文件夹的完整每日备份和这个数据到一个远程 服务器 的一个拷贝(这也可以工作于另一个VPS) 。我们还将成立一个rsync的例子,刚才复制的增量变化。最后,我们将建立一个MySQL数据库的备份。该程序描述使用几个简单的bash命令, rsync的和cron来安排备份。例如数据,我们就可以安装WordPress的按照本教程。它将把WordPress在/var/www/WordPress的目录和MySQL数据库的WordPress ,我们现在要采取的所有数据的备份。 快照和备份,来处理备份和快照非常好。也有优秀的,与最低配置备份工作作为一种服务解决方案。但有时我们想使用其他备份服务器或者一个服务器点播服务,并且我们希望有一个快速的方法来拉从主机商到我们的服务器上的数据。在这种情况下,这些技巧可以帮助。 有两种方法可以做到备份:增量备份和完全备份。一个完整的备份副本中的所有数据,而快照只处理自上次更新的变化。 完整备份 完全备份通常具有下列功能: 使所有的文件夹中的归档 生成的存档复制到远程服务器。 如前所述,我们的数据将驻留在/var/www/WordPress的目录。我们将指定备份文件夹位置。 mkdir -p /backup/wordpress

How do I extract a tar file using python 2.4?

好久不见. 提交于 2019-12-01 03:39:14
I'm trying to extract a .tar file completely using python 2.4.2 and because of this not all of the aspects of the tarfile module are usable. I've looked through the python documentary and I have not found it to be helpful as I continue to make syntax errors. The following are commands I have tried(to no success): tarfile.Tarfile.getnames(tarfile.tar) tarfile.Tarfile.extract(tarfile.tar) Is there a simple way to extract my tar completely? If so what is the formatting used? Also, I'd like to note that tarfile.TarFile.extractall() is not available in my python version. This example is from the

Extract a .tar.gz file in java (JSP)

心已入冬 提交于 2019-12-01 03:29:13
问题 I can't seem to import the packages needed or find any online examples of how to extract a .tar.gz file in java. What makes it worse is I'm using JSP pages and am having trouble importing packages into my project. I'm copying the .jar's into WebContent/WEB-INF/lib/ and then right clicking on the project and selecting import external jar and importing it. Sometimes the packages resolve, other times they don't. Can't seem to get GZIP to import either. The imports in eclipse for jsp aren't

Linux下的解压命令

我们两清 提交于 2019-12-01 02:58:42
Linux下常见的压缩包格式有5种:zip tar.gz tar.bz2 tar.xz tar.Z 其中tar是种打包格式,gz和bz2等后缀才是指代压缩方式:gzip和bzip2 filename.zip的解压: unzip filename.zip filename.tar.gz的解压: tar -zxvf filename.tar.gz 其中zxvf含义分别如下 z:   g z ip          压缩格式 x:   e x tract         解压 v:   v erbose        详细信息 f:    f ile(file=archieve)    文件 filename.tar.bz2的解压: tar -jxvf filename.tar.bz2 j:   bzip2          压缩格式 其它选项和tar.gz解压含义相同 filename.tar.xz的解压: tar -Jxvf filename.tar.xz 注意J大写 filename.tar.Z的解压: tar -Zxvf filename.tar.Z 注意Z大写 关于tar的详细命令可以: tar --help 事实上, 从1.15版本开始tar就可以自动识别压缩的格式,故不需人为区分压缩格式就能正确解压 tar -xvf filename.tar.gz tar -xvf

how to rename files you put into a tar archive using linux 'tar'

╄→гoц情女王★ 提交于 2019-12-01 02:32:21
I'm trying to create a tar archive with a couple files, but rename those files in the archive. Right now I have something like this: tar -czvf file1 /some/path/to/file2 file3 etc But I'd like to do something like: tar -czvf file1=file1 /some/path/to/file2=file2 file3=path/to/renamedFile3 etc=etc Where, when extracted into directory testDir, you would see the files: testDir/file1 testDir/file2 testDir/path/to/renamedFile3 testDir/etc How can I do this? You can modify filenames (among other things) with --transform . For example, to create a tape archive /tmp/foo.tar , putting files /etc/profile

7-2 文件查找和压缩归档

限于喜欢 提交于 2019-12-01 02:26:52
文件查找和压缩归档 文件查找 locate命令 介绍 查询系统上预建的文件索引数据库 /var/lib/mlocate/mlocate.db 依赖于事先构建的索引 索引的构建是在系统较为空闲时自动进行(周期性任务),管理员手动更新数据库(updatedb) 索引构建过程需要遍历整个根文件系统,极消耗资源 工作特点: 查找速度快 模糊查找 非实时查找 搜索的是文件的全路径,不仅仅是文件名 可能只搜索用户具备读取和执行权限的目录 语法 locate KEYWORD 常用选项 -i 不区分大小写的搜索 -n N 只列举前N个匹配项目 -r 使用基本正则表达式 示例 搜索名称或路径中带有“conf”的文件 locate conf 使用Regex来搜索以“.conf”结尾的文件 locate -r ‘\.conf$’ find命令 介绍 实时查找工具,通过遍历指定路径完成文件查找 工作特点: 查找速度略慢 精确查找 实时查找 可能只搜索用户具备读取和执行权限的目录 语法 find [OPTION]... [查找路径] [查找条件] [处理动作] 查找路径:指定具体目标路径;默认为当前目录 查找条件:指定的查找标准,可以文件名、大小、类型、权限等标准进行; 默认为找出指定路径下的所有文件 处理动作:对符合条件的文件做操作,默认输出至屏幕 查找条件 指定搜索层级: -maxdepth level

Linux目录结构

随声附和 提交于 2019-12-01 02:16:41
Linux目录结构 Linux目录结构是树形的目录结构 根目录 所有分区、目录、文件等的位置起点 整个树形目录结构中,使用独立的一个“/”表示 常见的子目录 目录 目录名称 目录 目录名称 /root 管理员家目录 /bin 所有用户可执行命令文件目录 /boot 系统内核、启动文件目录 /dev 设备文件 /etc 配置文件 /home 用户家文件目录 /var 变量文件(日志文件) /usr 用户应用程序文件目录 /sbin 管理员可执行的管理命令 /proc 硬件信息存放目录 查看及检索文件命令 cat命令 cat命令:显示并连接文件内容 格式 ​ cat [选项] 文件名 … [root@localhost ~]# cat /mnt/tast02.txt //输入命令,查看文件内容 this is tast02 //显示文件内容 [root@localhost ~]# more 和 less 命令 more命令:全屏方式分页显示文件内容(当阅读完时自动退出阅读模式,不可直接回看) 格式 ​ more [选项] 文件名 ... 交互操作方法 按Enter键向下逐行滚动 按空格键向下翻一屏 按b键向上翻一屏 按q键退出 [root@localhost ~]# more /etc/httpd/conf/httpd.conf # # This is the main Apache