[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Archiver Cron Jobs



I'm pretty new to cron jobs, and I've just started playing around with
them pretty recently.

I'd like to be able to create a cron job that does a weekly archive of
all of my folders in ~/mail. The way I have my mail set up is one
folder per box, for example my folders are:

~/mail/inbox
~/mail/debian-user
~/mail/sent

I'd like the Cron job to archive these on a weekly basis, but not
exactly on a weekly basis.

The part that is tough for me to figure out is...I want the cron job
to only archive when the file is a week old. So I'd need it to do a
daily check of my folders and their contents (And the dates they were
created), and if they're older than seven days old move them into
~/mail/archives/<folder> (Archive would be a mirror image of the
directories in ~/mail).

I imagine something like this can be done in bash or similar, but I
have no experience doing bash.

Thanks for your time,
Michael Pobega



Reply to: