BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
RupaJ
Lapis Lazuli | Level 10

Hello,

 

I understand this is not a SAS question, however I would really like to understand (for my peace of mind) how other SAS administrators take /opt/sas/ backup before a major upgrade. The commands I have used have failed me or haven't served the purpose. Hopefully I could get some clarification that can also be helpful for other SAS admins. 

 

Here is what I do when I need to take a /opt/sas backup. 

 

1) Stop the services first

2) cd /opt/sas/config/Lev1 (Go to the config directory)

3) Run the command tar -cf /Backup_location/backup_name.tar  * (asterisk to take a backup of all files) 

 

Is this above correct method ? Now when I need to extract (untar), then I run "tar -xf backup_name.tar" in the location /opt/sas/config/Lev1. 

 

Are there better/fool proof methods of doing this process? 

 

Thanks!

 

1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

I would not use tar for this. tar copies everything to a single sequential file (as it was originally used to stream disk data to tape), without compressing.

I rather recommend to stop all your SAS services and copy the whole configuration tree to a secondary location (cp -prh). This makes it much easier to compare the states (before - after) on a file level.

View solution in original post

6 REPLIES 6
ballardw
Super User

You should describe what in your process has failed or not performed as desired.

If there are specific items that weren't handled then listing them may help someone with more expertise than I have get you to a solution quicker.

 

TAR tells me you are likely working in Unix and that isn't my expertise. But there are things in a Windows install that would not be captured just backing up the, mostly text, files in the configuration folder(s).

SASKiwi
PROC Star

If you are doing a major upgrade, then it is best practice to do a full cold backup. If you don't know what this is then it means all SAS services / processes are stopped and a complete copy is taken of all system disk drives. In my experience, this is done by IT support and is not something a SAS administrator needs to be involved in.

 

Then if you want to restore back to your pre-upgrade configuration, you do a complete restore of the system backup.

angian
SAS Employee

Are you running the tar commands as sudo?  You want to make sure you are running it with the superuser (sudo) so the permissions and ownership are preserved.

 

tar czvf
tar xzvf

 

Kurt_Bremser
Super User

I would not use tar for this. tar copies everything to a single sequential file (as it was originally used to stream disk data to tape), without compressing.

I rather recommend to stop all your SAS services and copy the whole configuration tree to a secondary location (cp -prh). This makes it much easier to compare the states (before - after) on a file level.

Anand_V
Ammonite | Level 13

I agree with @Kurt_Bremser. I have always used cp -pr /opt/sas /mydir/sas-backup to do a cold backup after all the SAS services and processes are shut down. It's also better to compare the size of the directories after taking the backup.

 

If your configuration has SAS workspace or other logs enabled, user written files then you should use sudo or root to preserve the permissions. If you have multiple backups you can tar few of them to save disk space.

RupaJ
Lapis Lazuli | Level 10

Thanks everyone for your responses! "cp - pr " does seem to be a more efficient way than TAR. 

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 1154 views
  • 1 like
  • 6 in conversation