Delete and sync files periodically?

I’ve the WD My Cloud 2GB and save thousands of images to the drive with an IP web cam Axis 207W.

I’ve been redaing, that SSH is available and now I need to know how to setup a DEL-Job (all files older than 30days) and ideally an rsync to a cloud storage (dropbox)? Is there any guideline with details?

The following command will delete files older than 30 days

find /path/to/files/ -mtime +30 -exec rm -rf {} ;

AWAYS TEST ON A DUMMY FOLDER/FILES FIRST!

where to store this line of code and how to start the code every day?

EDIT: this is what I found…

1.) connect to WD via SSH and Windows tool WinSCP

2.) place file with code unter /usr/local/sbin and name the file *.sh

3.) add file to crontab line under /etc/crontab

=> is that correct?