YoYoo 0 Posted April 20, 2014 Share Posted April 20, 2014 i want to create a .sh file in the scope of deleting the server logs . I have the logs in /usr/home/game/logs/channel1/core1 or core2 ... Can anyone help me because i don't know the unix language and the cd command works really strange . Sorry for my bed english Link to comment Share on other sites More sharing options...
YoYoo 0 Posted April 20, 2014 Author Share Posted April 20, 2014 i want that the script to delete all the logs from 1 to 4 channel ( each of the channels have 5 cores) Link to comment Share on other sites More sharing options...
Padrio 991 Posted April 20, 2014 Share Posted April 20, 2014 Just create a cron with the folowing commands: rm -rf /usr/home/game/logs/channel1/core1/*.log But adjust the paths! Link to comment Share on other sites More sharing options...
YoYoo 0 Posted April 20, 2014 Author Share Posted April 20, 2014 i alrdedy made this and i create a (a.sh) file with "rm -rf /usr/home/game/logs/*/*/*/" when i execute it mannualy in putty the command it works and when i use sh a.sh , rm function doesn't work , it doesn't delete the files Link to comment Share on other sites More sharing options...
Padrio 991 Posted April 20, 2014 Share Posted April 20, 2014 Does the file start with #!/bin/sh If its only this line you dont need a shell file, just execute the command directly. Link to comment Share on other sites More sharing options...
YoYoo 0 Posted April 20, 2014 Author Share Posted April 20, 2014 thx you a lot ! Link to comment Share on other sites More sharing options...
YoYoo 0 Posted April 20, 2014 Author Share Posted April 20, 2014 wht it doesn'y work if the file doesn't start with #!/bin/sh ? Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now