I am a scripting novice. I am trying to write a simple bash script for my Ubunutu 10.04 server to delete archives in a folder older than 30 days & older than a year in a different folder. They can be two different command lines, as I will be putting them in different scripts.
I was just starting out by trying the following, which does not work at all:
# find ~/addon_backups/202 -name 202adata* -maxdepth 0 -ctime +30
and
# find ~/addon_backups/202/ME -name *.tar.gz -maxdepth 0 -ctime +365
I am getting the following respectively:
find: paths must precede expression: 202adata_010213.tar.gz
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
and
find: paths must precede expression: 0213ME-202.tar.gz
Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
I have tried multiple variations and I am clearly missing something. Any help is appreciated.