I have this cronjob.
50 15 * * * cd /var/www/html; for i in $(ls -d */); do tar zcvf ${i%%/}.tar.gz $i; done
But it shows me this.
/bin/sh: 1: Syntax error: Missing '}'
But when I run this command from command line directly, it works.
Where is the problem?
Thanks.