Uly.me

cloud engineer

  • Home
  • About
  • Archives
Home/Archives for archive

November 8, 2020

Tar List of Files

Here’s another way of creating a tar ball from a list of files.

tar -cvf backup.tar.gz a.txt b.txt c.txt d.txt e.txt

tar -cvf backup.tar.gz a.txt b.txt c.txt d.txt e.txt

Here’s how to view files in a tarball.

tar -tvf backup.tar.gz

tar -tvf backup.tar.gz

June 2, 2020

7zip in Linux

To install 7zip.

yum install 7za
apt install p7zip

yum install 7za apt install p7zip

To extract.

7za e compressedfile.7z

7za e compressedfile.7z

To archive.

7za a myarchive.7z myfiles/

7za a myarchive.7z myfiles/

September 8, 2019

Display Last 50 Posts in Archive Page

Here’s the code to add to your archive template, e.g. archives.php.

<h2>Last 50 Posts:</h2>
<ul>
<?php wp_get_archives( array( 
	'type' => 'postbypost',
	'limit' => 50,
	'format' => '',
	'before' => '<li>',
	'after' => '</li>' 
)); ?>
</ul>

<h2>Last 50 Posts:</h2> <ul> <?php wp_get_archives( array( 'type' => 'postbypost', 'limit' => 50, 'format' => '', 'before' => '<li>', 'after' => '</li>' )); ?> </ul>

August 30, 2019

Copy Files Using Rsync

Here’s how to copy files from one directory to another.

rsync -arvz /dir1 /dir2 >> /tmp/rsync.log &

rsync -arvz /dir1 /dir2 >> /tmp/rsync.log &

Format: rsynch –options source destination

Options

  • -a archive mode
  • -v verbose
  • -p keep permissions
  • -z zipped during transfer
  • -r recursive
  • Cloud
  • Linux
  • Git

Copyright © 2012–2021