3 deleted 8 characters in body; edited tags
source | link

I recently came up to an easy fix for a crontab logging issue and I am wondering what are the pro's and con's of using this specific fix (running a script with a "login shell flag"), as:

#!/bin/bash -l 

Thanks

I recently came up to an easy fix for a crontab logging issue and I am wondering what are the pro's and con's of using this specific fix (running a script with a "login shell flag"), as:

#!/bin/bash -l 

Thanks

I recently came up to an easy fix for a crontab logging issue and I am wondering what are the pro's and con's of using this specific fix (running a script with a "login shell flag"), as:

#!/bin/bash -l 
2 deleted 551 characters in body
source | link

I recently came up to an easy fix for a crontab logging issue and I am wondering what are the pro's and con's of using this specific fix (running a script with a "login shell flag").

The issue : I couldn't redirect stdout and stderr of a script launched by a crontab by using the following form:

51 10 * * * /path/to/script.bash -y start &> /path/to/logs/test.log

So I finally set the "login shell" flag inside the script, as  :

#!/bin/bash -l 

It did fix the issue, but I am really interested in potential risks (security or any other risks) of this "hack".

Note : I am well aware of the fix consisting in defining a specific shell inside the crontab entry, but for some reasons I'd prefer not to edit the existing crontab entries ...

Thanks

I recently came up to an easy fix for a crontab logging issue and I am wondering what are the pro's and con's of using this specific fix (running a script with a "login shell flag").

The issue : I couldn't redirect stdout and stderr of a script launched by a crontab by using the following form:

51 10 * * * /path/to/script.bash -y start &> /path/to/logs/test.log

So I finally set the "login shell" flag inside the script as  :

#!/bin/bash -l 

It did fix the issue, but I am really interested in potential risks (security or any other risks) of this "hack".

Note : I am well aware of the fix consisting in defining a specific shell inside the crontab entry, but for some reasons I'd prefer not to edit the existing crontab entries ...

Thanks

I recently came up to an easy fix for a crontab logging issue and I am wondering what are the pro's and con's of using this specific fix (running a script with a "login shell flag"), as:

#!/bin/bash -l 

Thanks

1
source | link

What are the pro's and con's in using the "-l" in a script shebang

I recently came up to an easy fix for a crontab logging issue and I am wondering what are the pro's and con's of using this specific fix (running a script with a "login shell flag").

The issue : I couldn't redirect stdout and stderr of a script launched by a crontab by using the following form:

51 10 * * * /path/to/script.bash -y start &> /path/to/logs/test.log

So I finally set the "login shell" flag inside the script as :

#!/bin/bash -l 

It did fix the issue, but I am really interested in potential risks (security or any other risks) of this "hack".

Note : I am well aware of the fix consisting in defining a specific shell inside the crontab entry, but for some reasons I'd prefer not to edit the existing crontab entries ...

Thanks