Rotate logs
cLaSic
-
jipicy Messages postés 40842 Date d'inscription Statut Modérateur Dernière intervention -
jipicy Messages postés 40842 Date d'inscription Statut Modérateur Dernière intervention -
Hello,
I wrote two bash scripts :
bash1.sh (will call bash2.sh and write logs to a daily file)
Code:
#!/bin/bash
./bash2.sh >> log`date +%d_%m_%y` 2>&1
bash2.sh (will loop indefinetly and write the current time)
Code:
#!/bin/bash
while [ 1 -eq 1 ]
do
date '+%H:%M:%S'
sleep 1
done
I'm expecting the logs to be written in a seperate file each day. But if you launch bash1.sh you will see that even if you change the system time, logs will be writte n in the same file :/
Any idea ? any hints are welcome.
Regards,
cLaSic
I wrote two bash scripts :
bash1.sh (will call bash2.sh and write logs to a daily file)
Code:
#!/bin/bash
./bash2.sh >> log`date +%d_%m_%y` 2>&1
bash2.sh (will loop indefinetly and write the current time)
Code:
#!/bin/bash
while [ 1 -eq 1 ]
do
date '+%H:%M:%S'
sleep 1
done
I'm expecting the logs to be written in a seperate file each day. But if you launch bash1.sh you will see that even if you change the system time, logs will be writte n in the same file :/
Any idea ? any hints are welcome.
Regards,
cLaSic
A voir également:
- Rotate logs
- View recovery logs - Guide
- Rotate screen windows - Guide
- No logs vpn - Guide
- Tkinter canvas rotate - Forum Python
- (XP) ÉCRAN ROTATÉ!!! ✓ - Forum Windows