Title: Excluding folder from backup // BackupRestore.php
Last modified: February 7, 2017

---

# Excluding folder from backup // BackupRestore.php

 *  [MaxT](https://wordpress.org/support/users/maxt/)
 * (@maxt)
 * [21 years, 6 months ago](https://wordpress.org/support/topic/excluding-folder-from-backup-backuprestore-php/)
 * Ughm… Was looking for like 1 hour now in BackupRestore.php figuring the way how
   to exclude one folder from backupping process.
    Anyone have any idea? like `$
   tar = new Archive_Tar($file_name, "true", exclude_folder='excluded_folder'); 
   usually I would just tar --exclude=excluded_folder --exclude=*.pdf blablabla...
   but since I got no access to shell on that host... >_<

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [21 years, 6 months ago](https://wordpress.org/support/topic/excluding-folder-from-backup-backuprestore-php/#post-104693)
 * You could do it the manual way, assuming you have access to phpmyadmin.
    [http://tamba2.org.uk/wordpress/backup/](http://tamba2.org.uk/wordpress/backup/)
 *  Thread Starter [MaxT](https://wordpress.org/support/users/maxt/)
 * (@maxt)
 * [21 years, 6 months ago](https://wordpress.org/support/topic/excluding-folder-from-backup-backuprestore-php/#post-104699)
 * wasn’t talking about backupping mysql db… but *folders*
    ahem
 *  Moderator [James Huff](https://wordpress.org/support/users/macmanx/)
 * (@macmanx)
 * [21 years, 6 months ago](https://wordpress.org/support/topic/excluding-folder-from-backup-backuprestore-php/#post-104704)
 * You could do it the manual way, assuming you have access to FTP and can download
   folders and files.
 *  Thread Starter [MaxT](https://wordpress.org/support/users/maxt/)
 * (@maxt)
 * [21 years, 6 months ago](https://wordpress.org/support/topic/excluding-folder-from-backup-backuprestore-php/#post-104712)
 * Yes I could, thank you 🙂 But I prefer to compress the site and then DL 1 file
   which is smaller and takes 100 times less time to download instead of downloading
   hundreds of small files…
 *  Thread Starter [MaxT](https://wordpress.org/support/users/maxt/)
 * (@maxt)
 * [21 years, 6 months ago](https://wordpress.org/support/topic/excluding-folder-from-backup-backuprestore-php/#post-104719)
 * Hmm… thnx for the snippet, tho’ I got no luck with it (getting blank page with
   no errors and no backup file were created)
    😐 I guess my host limits usage of
   exec cmd 😐
 *  Thread Starter [MaxT](https://wordpress.org/support/users/maxt/)
 * (@maxt)
 * [21 years, 6 months ago](https://wordpress.org/support/topic/excluding-folder-from-backup-backuprestore-php/#post-104782)
 * Tried with chmod 777 and looked into script once again to be sure about destination,
   still no luck 😐
    1) MySQL db down over there, will look for similar scripts 
   at Google 2) Prolly, but… There is allready one script that works with WP, why
   reinvent the wheel? And I’m 100% sure that it can be set up to exclude some folders…
   There are even funcs for that in tar.php… I just can’t figure out (yet) how to
   use’em… 😐 Thanks for your time tho’ 🙂 Hrmpf…
 *  Thread Starter [MaxT](https://wordpress.org/support/users/maxt/)
 * (@maxt)
 * [21 years, 6 months ago](https://wordpress.org/support/topic/excluding-folder-from-backup-backuprestore-php/#post-104795)
 * k, it’s not possible… forget it…
    you could do it one way : make archive of all
   4 folders, then index it (make a list of all files in the archive (and I got 
   +2000 I think and each file will generate about 7-8 lines of info)), then find
   files you don’t need (by their ID from index list), and then run another script
   which will delete those files with needed IDs from the archive… Usefull? Not 
   at all… Cause I can’t create the first file at all (execution time > 30 secs)…
   And gathering IDs for about 2000 files from that Index list… Eh… no way dude…
   Consider this thread closed

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Excluding folder from backup // BackupRestore.php’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 2 participants
 * Last reply from: [MaxT](https://wordpress.org/support/users/maxt/)
 * Last activity: [21 years, 6 months ago](https://wordpress.org/support/topic/excluding-folder-from-backup-backuprestore-php/#post-104795)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
