Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I'm looking for a way to delete all files of the Downloads folder with a shell script or applescript that is run on a daily/weekly basis and most importantly backs up all of the file details, except the data itself.

Deleting the files, and scheduling the script is not a problem, I could even do it with automator. The only part I really don't know how to do is the backing up of file details. I would like to backup the list of files with their details. Ideally it would be something like creating an alias for every file. To save a sort of browsable back-up without the data, just the file details.

share|improve this question

migrated from stackoverflow.com May 22 '12 at 13:00

This question came from our site for professional and enthusiast programmers.

add comment

2 Answers

up vote 0 down vote accepted

In a script:

cd ~/Downloads
ls - l * >> ~\backup.txt
rm -rf *`
share|improve this answer
add comment

For deleting the contents of a file you could use:

sudo echo "" > filename.ext

Hopefully will this help you enough to continue.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.