Skip FTP folder during backup

donkeyKICK

Verified User
Joined
Jul 24, 2007
Messages
389
I have some users with huge amounts of static stuff in their ftp directories. When I run a backup, all this stuff gets backed up. I want to skip this stuff, thereby greatly reducing my backup size. I'll backup the ftp stuff seperately much less frequently.

Any recomendations on how to go about this?
 
What do you mean by static stuff? Right now the ftp backups are full backups and not incremental.
 
For example, one customer has approx 40 gigs of iso files, and then 15,000 jpg files. This stuff isn't updated often, and I really only need to back it up about once every few months.
 
You could probably rename the ftp directories just before the backup runs and then after the backup rename it back. AFAIK the backup system backs up specific directories not just everything in the home directory. So by renaming it the backup system cannot find it and moves on.
 
That won't really work for automatic backups. The reason I want to find a way to stop the backup from doing the FTP is that I want the backup to be able to run automatically on the cron.

Sounds like the only way to do an automatic backup is to use the DA one once for all the settings, and then do an rsync or something for the rest.

I was really hoping for a way to use the DA one and just skip the ftp
 
Well, I could set a cron to rename the files before the backup, but how would I rename them after? The backup finish time varies.

Also, doing it this way would cause the ftp to fail during backup. Right now my backups run for about 3 hours. In the middle of the night running slow is okay, but I still want people to have access to their stuff.
 
Last edited:
Right now my backups run for about 3 hours.


But it will not take nearly that long if you are not backing up all the large files in ftp.


A cron job could also be used to detect when the backups are finished.

Everything can be done. You just have to be a little creative.
 
How would I know that the backup is done? You mentioned that I could setup a cron to detect this...

Also, I was wondering how you would go about globally skipping ftp from backups? Are you running a tool for backups besides the one in DA? How are you going about it?
 
How would I know that the backup is done?

If you look at the backup directory while the backup is running you will see a directory is created and all the files are are put there for the final tar.gz file to be made. When the directory is gone and nothing but tar.gz files are left that means the backup is done. Write a script to look for sub directories in the backup directory. Run it as a cron job after the backup cron begins. Remember the back cron will actually begin the following minute or whenever the dataskq runs.

I was wondering how you would go about globally skipping ftp from backups?

As I mentioned, rename the ftp directories just before the backup begins.

I am not entirely sure it will skip the directories if they are renamed. I don't know if da is looking for specific directories or just backing up everything. You will want to manually test this first.

Another way that might work is to chmod 000 the ftp directory. Then DA should not be able to read it in order to back it up. Again a theory.
 
Hello,

Probably a simpler solution would be to use directories that DA skips natively, and link to them as needed. It would require you to ensure that proftpd does not have chroot enabled for logins.. and that it allows links.. which could be potentially a bit hazardous, fyi.

The directories that DA skips for User backups are:

usr
bin
etc
lib
lib64
tmp
var

if any of these exist in:

/home/username/

then they're skipped. These skips are for those who jail their users (eg: /home/username/var).. as nobody cares about system libraries and binaries in their backups.

Anyway, so you'd basically do:
Code:
cd /home/[B]username[/B]/domains/[B]domain.com[/B]
mv public_ftp ../../var
ln -s ../../var ./public_ftp
and make sure permissions are good.

Then you'd edit the /etc/proftpd.conf and remove the line
Code:
DefaultRoot ~
.. which is what I believe does the chroot.. based on what I've googled (you may want to double check that)

The only issue would be if proftpd checks for links above the DocumentRoot or not.. that may prevent this from working at all (I have not tested it)

John
 
Then you'd edit the /etc/proftpd.conf and remove the line
Code:

DefaultRoot ~

.. which is what I believe does the chroot

That is correct but it also means that the ftp user will not be locked into the home directory. They can browse the entire server.
 
Back
Top