Link to home
Start Free TrialLog in
Avatar of XK8ER
XK8ERFlag for United States of America

asked on

blank text file

hello there,
I would like to create a cron to run every hour that can erase a txt file and leave it blank..
how can I do that?
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

0 * * * * /usr/bin/touch /path/to/file.txt
Avatar of XK8ER

ASKER

touch doesnt seem to be working
[(01:35 PM)][(root@alpha)] [(~)] $ cat aa.txt
sdfsdfsd
sdfsdfsd
sdfsdfsd
sdfsdfsd
sdfsdfsd
sdfsdfsd
sdfsdfsd
[(01:35 PM)][(root@alpha)] [(~)] $ /bin/touch aa.txt
[(01:35 PM)][(root@alpha)] [(~)] $ cat aa.txt
sdfsdfsd
sdfsdfsd
sdfsdfsd
sdfsdfsd
sdfsdfsd
sdfsdfsd
sdfsdfsd
[(01:35 PM)][(root@alpha)] [(~)] $

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of woolmilkporc
woolmilkporc
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial