Using Tar on Mac OS X to Create a CUCM Bulk Import File

Author
William Bell
Vice President, Solutions and Products

Resource forks are part of the Mac Operating System. They are responsible for storing information about a file such as the icon it should have, window shapes, and other meta data. Usually, resource forks are transparent to the user. However, when using a facility like tar, resource forks become quite opaque.

An example would help demonstrate the issue:

wolverine:bulk-import-lab wjb$ tar -cvf testimport2.tar *.csv
a ./._callpark.csv
a callpark.csv
a ./._css.csv
a css.csv
a ./._devicemobilityinfo.csv
a devicemobilityinfo.csv
a ./._devicepool.csv
a devicepool.csv
a ./._mediaresourcegroup.csv
a mediaresourcegroup.csv
a ./._mediaresourcegrouplist.csv
a mediaresourcegrouplist.csv
a ./._meetmenumber.csv
a meetmenumber.csv
a ./._partition.csv
a partition.csv
a ./._phonebuttontemplate.csv
a phonebuttontemplate.csv
a ./._region.csv
a region.csv
a ./._routegroup.csv
a routegroup.csv
a ./._routelist.csv
a routelist.csv
a ./._routepattern.csv
a routepattern.csv
a ./._softkeytemplate.csv
a softkeytemplate.csv
a ./._translationpattern.csv
a translationpattern.csv
In the above example, you can see that each file (e.g. callpark.csv) has a “tag along” (e.g. ./._callpark.csv). This “tag along” is the resource fork. If I were to upload testimport2.tar to CUCM and perform a validation on the file, it will fail. It will also fail to insert the bulk file. This is because the CUCM doesn’t know what all of those extra files are.
I poured over the Man page for tar and couldn’t find anything that would help remedy the situation. I tried to use the “–exclude” command line option with no success. After some digging I found out that you can mitigate this issue with a workaround.
The workaround involves creating an environment variable in your shell session. For Mac OS X versions prior to Leopard, the environment variable is COPY_EXTENDED_ATTRIBUTES_DISABLE. In Leopard, Snow Leopard, and Lion the environment variable is COPYFILE_DISABLED.
Another example:
wolverine:bulk-import-lab wjb$ export COPYFILE_DISABLE=true
wolverine:bulk-import-lab wjb$ tar -cvf testimport3.tar *.csv
a callpark.csv
a css.csv
a devicemobilityinfo.csv
a devicepool.csv
a mediaresourcegroup.csv
a mediaresourcegrouplist.csv
a meetmenumber.csv
a partition.csv
a phonebuttontemplate.csv
a region.csv
a routegroup.csv
a routelist.csv
a routepattern.csv
a softkeytemplate.csv
a translationpattern.csv
Using the “export” command, we create the environment variable and then run the tar command again. This time (as seen in the example) there is no extra baggage. This can be verified with tar -tf testimport3.tar.
Now, when I upload testimport3.tar to CUCM and validate the tar archive, everything passes. Now, of course, the next problem is ensuring the file entries successfully import. That is a much longer story!!

2 responses to “Using Tar on Mac OS X to Create a CUCM Bulk Import File

  1. Hi ,

    Good catch , I was fighting with this mistake and now it is working fine .

    Thank you for pointing me this 🙂

    Good blog too 🙂

    Olivier

  2. Olivier,

    Glad you found the information helpful and thanks for the feedback!

    Regards,
    Bill
    twitter: @ucguerrilla

Leave a Reply

 

Nick Kelly

Cybersecurity Engineer, Cisco

Nick has over 20 years of experience in Security Operations and Security Sales. He is an avid student of cybersecurity and regularly engages with the Infosec community at events like BSides, RVASec, Derbycon and more. The son of an FBI forensics director, Nick holds a B.S. in Criminal Justice and is one of Cisco’s Fire Jumper Elite members. When he’s not working, he writes cyberpunk and punches aliens on his Playstation.

 

Virgilio “BONG” dela Cruz Jr.

CCDP, CCNA V, CCNP, Cisco IPS Express Security for AM/EE
Field Solutions Architect, Tech Data

Virgilio “Bong” has sixteen years of professional experience in IT industry from academe, technical and customer support, pre-sales, post sales, project management, training and enablement. He has worked in Cisco Technical Assistance Center (TAC) as a member of the WAN and LAN Switching team. Bong now works for Tech Data as the Field Solutions Architect with a focus on Cisco Security and holds a few Cisco certifications including Fire Jumper Elite.

 

John Cavanaugh

CCIE #1066, CCDE #20070002, CCAr
Chief Technology Officer, Practice Lead Security Services, NetCraftsmen

John is our CTO and the practice lead for a talented team of consultants focused on designing and delivering scalable and secure infrastructure solutions to customers across multiple industry verticals and technologies. Previously he has held several positions including Executive Director/Chief Architect for Global Network Services at JPMorgan Chase. In that capacity, he led a team managing network architecture and services.  Prior to his role at JPMorgan Chase, John was a Distinguished Engineer at Cisco working across a number of verticals including Higher Education, Finance, Retail, Government, and Health Care.

He is an expert in working with groups to identify business needs, and align technology strategies to enable business strategies, building in agility and scalability to allow for future changes. John is experienced in the architecture and design of highly available, secure, network infrastructure and data centers, and has worked on projects worldwide. He has worked in both the business and regulatory environments for the design and deployment of complex IT infrastructures.