Spruce interactive

Noise

How to Tar/Untar Files on a Server without SSH Access

Posted: June 13th, 2012

Author: Ben Heller

 Details

In an ideal world, web developers would have SSH access to every server we use. But, it’s often the case that clients are with hosts that either don’t allow SSH or make you jump through hoops to enable it. Sometimes clients don’t even know who their host is, or how to access their administrative panel. So, we learn to make the most with what we have available. Media rich sites or WordPress installations with excess themes can either take seconds to move from development to production servers using SCP, or hours using FTP. Upload times are doubled or even tripled when each file has to be sent to the server individually rather than in a neat zip or tarball. Sure we can tar it on our end, but we can’t untar it once uploaded thanks to our crappy permissions. We recently ran into this problem and decided to Google around for an answer. Lo and behold, we stumbled upon this post, which suggests using PHP to untar the archive. While this won’t work on all servers, in our case it happened to be the perfect solution.

Compress

if(system("tar -czvf your-fine.tar.gz your-directory/")) 
echo '<br> <b>Directory compressed successfully!</b>';
 else echo '<br> <b>No Donuts for you :(, 
                command has been disabled by host!</b>';

Uncompress

if(system("tar -zxvf your-file.tar.gz")) 
echo '<br> <b>file uncompressed successfully!</b>';
 else echo '<br> <b>No Donuts for you :(, 
              command has been disabled by host!</b>';

Huge props to the original posters for this quick and simple solution. Just save one of the above snippits in a PHP file (we use untar.php), and point your browser to it. If successful, you’ll see the names of the files that have been uncompressed.

Talk to Us

Wise men have said, "All good things must come to an end", and so it was with Spruce. We began our first project in 2006, and completed our last in Fall 2013. It's been a wonderful experience, but now it's time to begin the next adventure.

Though...we wouldn't want to leave you hanging, now would we? Here are our top recommendations for world-class branding, design, and web development:

  • Kristina (KJ) Parish and Beam Collective:
    KJ provided the artistic vision that allowed Spruce to succeed, and we still think she's the greatest designer in the entire world. She's started a new collective with some talented developers, and is covering much the same territory as Spruce--design and development all under one roof, with a caliber of service and professionalism seldom seen in this business or any other. If you like what you see on the Spruce site, then definitely get in touch with KJ at kj@beamcollective.com
  • Permanent Art & Design
    Permanent is a nationally recognized design & branding firm out of Minneapolis, MN. They've been a long term collaborator and strategic partner over the past couple years, and we'd recommend them for medium to large sized businesses/organizations who are serious about putting their best foot forward. In addition to design, Permanent offers strategy and marketing services, plus in-house and networked developers. For more information contact Joseph Belk joseph@permanentadg.com
  • Nate Thompson
    A freelancer, Nate reminds us of ourselves back in the day. Smart, communicative, and skilled, Nate is our recommendation for small to medium sized businesses/organizations who have sites built on Wordpress or other open source content management solutions. With a background in both design and development, he's a one-stop shop for most web-related tasks. You can get in touch at nate.a.thompson@gmail.com
  • Kevin DeBernardi
    Designer turned developer, Kevin is embarking on a freelance web career after working as the in-house designer at the Museum of the City of New York. He's adept at translating his design ideas into custom PHP code, and is constantly expanding his technical palette. Kevin's a good choice for projects that don't quite fit into the Wordpress mold, and that would benefit from a consistency of presence and vision from design through execution. Kevin can be reached at kevin@analoglifestyle.com