help me for a script, please!

emau74
emau74 Posts: 53  Ally Member
who helps me make a script that runs every week and deletes the files of a certain folder?

Answers

  • Teemo
    Teemo Posts: 55  Ally Member
    Which model are you using?
  • emau74
    emau74 Posts: 53  Ally Member
    NAS326, tanks!
  • Mijzelf
    Mijzelf Posts: 1,787  Guru Member
    The script can be as easy as

    #!/bin/sh
    rm /path/to/directory/*

    Make it executable (chmod a+x /path/to/script), install Tweaks, and add a cron line

    34 12 * * 0 /path/to/script

    if you want to execute it each sunday at 12:34