Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8102461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T23:14:54+00:00 2026-06-05T23:14:54+00:00

Task: To provide facility to upgrade the system remotely or add new features. What

  • 0

Task: To provide facility to upgrade the system remotely or add new features.

What I am supposed to do Create a back up of current environment of target machine and if upgrading fails at any stage, then revert back to original environment.

Say my directory structures are something like this:

/home/user/project1/….bla bla

project 1 contains symbolic links, hard links, executable files of software and firmware etc.

My dilemma

Should I use strategy 1 or 2?

  1. Should I copy the whole current environment and revert back if upgrading fails.

    example -> cp -p -r /home/user/project1/* /home/user/project1_backup/

    if upgrading fails –>

    mv /home/user/project1_backup/ /home/user/project1

  2. Should I tarball the whole environment and untar it if upgrading fails. To create tar ball, I’m a bit skeptical about preserving symbolic links and hard links .. and same while untar it.

Could some please provide concrete answer which method I should follow and if I go with tar ball approach what will be the bash command.

As far as I know tar -cvfz for creating tar gunzip will not preserve the links and permissions and similarly while untarring the tar ball.
Please throw some light?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T23:14:55+00:00Added an answer on June 5, 2026 at 11:14 pm

    I would use the second option: create a tarball; because tarballs have some positive points:

    • You can preserve permission/specials files across filesystems (usefull when you backup your a ext* folder to an NTFS filesystem)
    • A copy of one single big file will be faster than a thousand small files
    • You can compress it.

    And here is the command:

    tar --preserve-permissions --preserve-order -jc /path/to/your/folder > /path/to/your/backup_file.tar.bz2
    

    This shall preserve your permission, your symlinks.
    And for the hardlinks, I give you this link (http://www.gnu.org/software/tar/manual/html_node/hard-links.html)

    (but by default, tar preserve hardlinks)

    Don’t forget to test your tarball before upgrading your system !!

    (you will avoid almost all lose of data in the case of the archive isn’t correctly created)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here I provide simple piece of code. function GetStringList:TStringList; var i:integer; begin Result:=TStringList.Create; Result.Add('Adam');
I am new to WCF,my task is to create,maintain sessions in WCF I have
My current task is to generate and provide centralized templates for a particular DOM
I was given a task to provide devices with < 1024x800 resolution with one
I want to provide a button which cancels the present task, Let's say I
i am new in blackberry development. and i have task to develop the application
My task is to create a parent-child hierarchy file using perl. Sample Input file
I've been given the task to write a plugin for Trac. It should provide
I have a task to create a wysiwyg editor as an eclipse plugin. Please
I'm building a system that needs to provide a commentary on things in natural

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.