Hey. Good thing you're liking GNU/linux. Learning basic commands and some shell scripting will help you for lots and lots of different tasks, and they're much fun to learn^^.
A script as the one you're looking for doesn't sound too hard, but you'll have to read some man pages or browse the web some too.
"find file weeks old" yielded
this which kind of gives you a hint of how to start.
First, read a bit the man page of the "find" command while reading that example.
So, a good start might be...
Code:
cd /home/username/my_temp_dir
find . -type f -daystart -ctime +7 -exec mv {} some_other_dir/ \;
Instead of deleting the files, as in the example, you'd be moving them to some_other_dir.
For the second part, you would need a basic "if" sentence (
read about bash scripting).
Code:
df |grep home|awk '{print $4}'
This command would return your available(not used) disk size in Kilobytes.
So you could say
Code:
if [ 100000 -gt $(df |grep home|awk '{print $4}') ] ; then
#translation= "if 100000K is more than my disk's free space, then..."
# or simpler "if I have less than 100000K available, then..."
move_old_files_function_here
fi
Do please read all command's man pages, at least so you understand what you're doing (awk is kinda huge, but basically it's priting its input's 4th field).
After finishing this (and ordering all under different files, or one single file with separated functions), you can use cron or crontab to schedule the script to run as often as you want.
For the third part you'd have to know about regular expressions and depending on the method you use may not be so simple to do...