My Ubuntu system is set up as an FTP server. I have several networked security cameras which send hundreds of MPEG4 video clips to the FTP server every day. These files are stored on a USB-attached external HDD. Each file is about 1.5MB. This works well. The computer is an old laptop with minimal processing power but its only purpose is to save the FTP'd files. I'm running 12.04.

My problem is that the folders the video clips are stored in eventually have thousands of files. Just to open a folder to view the clips takes up to a half hour. And forget about trying to drag/drop these files to another folder - that will take hours or days.

What I would like to do is, on a daily basis, have all files older than a week moved to a series of backup folders that are created automatically and named by the year/month/week. This will keep the number of files in each folder manageable and readily indexed by the week of the year. No need to compress the files as they are already MPEG4 and I have plenty of storage.

I've looked at several backup/archival apps and just can't seem to find something that will do what I need. Are there any apps that can do such a thing? If not, I imagine a cron job that runs a script would be appropriate but from what I've read up on so far, it's getting too complex for my experience level with Linux command line.



in command line

use crontab -e.

You will need to look up the details under man crontab. In general it will be something like

  1. Open crontab -e and pick your favorite command line editor.
  2. Enter the line in the crontab file as schedule space command. The schedule needs to be as describe in man crontab when and how often to run command.
  3. The command will be something like
    cd /media/usb0; mkdir `date +%Y-%m-%d`; mv *.mpg `date +%Y-%m-%d`

I think that either a crontab or other shcheduled task that runs the command in item 3 is going to be the most widely understood answer. I am not aware of any GUI programs, but then again, I never looked.


I've used gnome-schedule, and it is sufficient for needs.

It has a very simple UI.

You can download it from the Ubuntu software center.

Install via the software center


If you have access to these folders through FTP account, you can use AutoFileMove to setup a schedule which will transfer files older than X number of days to the other folder automatically.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.