I am running a cron job everyday at 21:00 UTC which downloads few csv files from sftp server, renames the downloaded files and then loads the files in database(mysql) and updates the time in database (mysql).  ps -ef | grep cron | grep -v grep root      2656     1  0 May28 ?        00:00:13 crond   cron jobs   37 21 * * * cd /opt/currentdata/ &amp;&amp; ./dbupdate.sh &gt;&gt; /opt/scriptlogs/db1.log 2&gt;&amp;1 30 21 * * * cd /opt/currentdata/ &amp;&amp; ./dwnldsftp.sh &gt;&gt; /opt/scriptlogs/db2.log 2&gt;&amp;1 35 21 * * * cd /opt/currentdata/ &amp;&amp; /usr/bin/python /opt/currentdata/files2.py &gt;&gt; /opt/scriptlogs/filerename.log 2&gt;&amp;1 40 21 * * * cd /opt/currentdata/ &amp;&amp; /usr/bin/python /opt/currentdata/tymup.py &gt;&gt; /opt/scriptlogs/timeupd.log 2&gt;&amp;1   cron jobs are setup as root user and I have provided the permissions to these files as below  -rwxrwxrwx 1 root     root  246 Jul 27 19:27 dwnldsftp.sh -rwxrwxrwx 1 root     root 3095 Jul 28 04:20 dbupdate.sh -rwxrwxrwx 1 root     root 3069 Jun 12 19:07 files2.py -rwxrwxrwx 1 root     root  512 Jul 28 09:02 tymup.py   once the csv files are downloaded I have described in dwnldsftp.sh script to make those files as executable read write. To the whole folder I have kept the scripts I have made them as read write execcutable.  Problem : The cron job runs everyday but it doesnt update the database, I have tried keeping the path of mysql in script top as well , it dowloads the file from SFTP server and renames as well the script for time update in database also runs but loading of csv files in database does not happen.  SHELL=/bin/bash PATH=/sbin:/bin:/usr/sbin:/usr/bin   But when I manually execute this scripts after doing SSH to my instance and become root user it works absolutely fine.  There are no errors logged in cron logs  CROND[14202]: (root) CMD (cd /opt/currentdata/ &amp;&amp; ./dwnldsftp.sh &gt;&gt; /opt/scriptlogs/db2.log 2&gt;&amp;1) CROND[14213]: (root) CMD (cd /opt/currentdata/ &amp;&amp; /usr/bin/python /opt/currentdata/files2.py &gt;&gt; /opt/scriptlogs/filerename.log 2&gt;&amp;1) CROND[14216]: (root) CMD (cd /opt/currentdata/ &amp;&amp; ./dbupdate.sh &gt;&gt; /opt/scriptlogs/db1.log 2&gt;&amp;1) CROND[14225]: (root) CMD (cd /opt/currentdata/ &amp;&amp; /usr/bin/python /opt/currentdata/tymup.py &gt;&gt; /opt/scriptlogs/timeupd.log 2&gt;&amp;1)   Can anyone help me here what I am missing here ?  EDIT :  Conditions when cron works :  I SSH to instance become root user , then execute those above 4 files manually(SFTP file download, rename files, update database, update time) so data is updated in database successfully now I set the cron job to run just next 15 minutes after the time I executed the scripts manually for whole flow (SFTP file download, rename files, update database, update time) and logout the SSH session. cron works successfully and data in database is updated.  When cron doesn't works :  I SSH into instance execute command crontab -u root -e then I set the cron jobs for whole flow (SFTP file download, rename files, update database, update time) to run at 21:00 UTC as described above, then logout from SSH session. I check next day the data is updated or not in database I find that data is not updated , I check cron logs where I see that cron executed successfully.
This is a  about using cron &amp; crontab.   You have been directed here because the community is fairly sure that the answer to your question can be found below. If your question is not answered below then the answers will help you gather information that will help the community help you. This information should be edited into your original question.  The answer for 'Why is my crontab not working, and how can I troubleshoot it?' can be seen below.  This addresses the cron system with the crontab highlighted.
Write a formula in an Excel Cell using VBA I'm trying to use VBA to write a formula into a cell in Excel. My problem is that when I use a semicolon (;) in my formula, I get an error:     Run-time error 1004   My macro is the following :   Sub Jours_ouvres()     Dim Feuille_Document As String     Feuille_Document = "DOCUMENT"             Application.Worksheets(Feuille_Document).Range("F2").Formula = "=SUM(D2;E2)"     End Sub What is a virtual terminal for? Can an html element have multiple ids? I understand that an id must be unique within an HTML/XHTML page.  My question is, for a given element, can I assign multiple ids to it?  &lt;div id="nested_element_123 task_123"&gt;&lt;/div&gt;   I realize I have an easy solution with simply using a class. I'm just curious about using ids in this manner. Down arrow button for choosing the desired site Derivative of determinant of a matrix I would like to know how to calculate:  $$\frac{d}{dt}\det \big(A_1(t), A_2(t), \ldots, A_n (t) \big).$$ How can I delete my account? How can I delete my Stack Exchange account(s)? Also,  What happens to my content? Can I request it be deleted as well? What if I'm suspended, rate-limited, or banned from posting questions or answers? What will happen to my votes? Will other users be impacted? Why wasn't my account deleted immediately after the timer expiring? What will happen to my pending bounties and close, reopen, delete, or undelete votes? I want my account deleted on all Stack Exchange sites. How do I do this? Will my profile on chat be removed once I delete my site account?   For more information, see &quot;&quot; in the . Custom Layout in android Is there any way to shorten URL in SMS in Marketing Cloud? I am trying to schedule an SMS in the journey to the subscribers who did not open their email. I want to redirect the subscribers to their hosted email page.  I am using the below code to populate hosted email link in email.  %%=RedirectTo(CloudPagesURL(383,'Id',@Id))=%%   In the message, it's showing up.        How can I shorten this URL? Is there a nice example of integral domain $R$ and $s,t \in R$, with $Rs \cap Rt$ not principal but lcm($s,t$) exists? I am currently searching for an integral domain $R$ which allows lcm, but where the intersection of two principal ideals is not necessarily a principal ideal (or at least an example with two certain elements).   As converse example (where the sum of two ideals is not principal but $R$ allows gcd) is $\mathbb Z[X]$. It allows gcd, but obviously $\left&lt;X+1,2\right&gt;$ is not principal.  An example of an integral domain where the intersection of two principal ideals is not principal would be $\mathbb Z[\sqrt{-5}]$ with the ideal $\left&lt;2\right&gt; \cap \left&lt;1+\sqrt{-5}\right&gt;$, but this doesn't allow lcm.  Since I can't find a nice example, I put the question here. Maybe someone has already seen this? (I am not completely sure, one even exists, but pretty certain there is an example. In the case my hunch is wrong, I would be happy, if someone could proof me wrong.) This question has bugged me for a while. I want to write a nested function, f(g(x)). If I naively enter it:  \begin{align}     f(g(x))=y \end{align}     The problem is that each and every parenthesis is the same size as all of the others. Shouldn't the outer parentheses be larger? But if I do this:  \begin{align}     f\left(g(x)\right)=y \end{align}     Now it looks even less like the functions are nested. What's the proper way to do this? I need to cast single figures (1 to 9) to (01 to 09). I can think of a way but its big and ugly and cumbersome. I'm sure there must be some concise way. Any Suggestions What is a magic number, and why is it bad? I have a SQL query that I am trying to optimize:  DECLARE @Id UNIQUEIDENTIFIER = 'cec094e5-b312-4b13-997a-c91a8c662962'  SELECT    Id,   MIN(SomeTimestamp),   MAX(SomeInt) FROM dbo.MyTable WHERE Id = @Id   AND SomeBit = 1 GROUP BY Id   MyTable has two indexes:  CREATE NONCLUSTERED INDEX IX_MyTable_SomeTimestamp_Includes ON dbo.MyTable (SomeTimestamp ASC) INCLUDE(Id, SomeInt)  CREATE NONCLUSTERED INDEX IX_MyTable_Id_SomeBit_Includes ON dbo.MyTable (Id, SomeBit) INCLUDE (TotallyUnrelatedTimestamp)   When I execute the query exactly as written above, SQL Server scans the first index, resulting in 189,703 logical reads and a 2-3 second duration.   When I inline the @Id variable and execute the query again, SQL Server seeks the second index, resulting in only 104 logical reads and a 0.001 second duration (basically instant).  I need the variable, but I want SQL to use the good plan. As a temporary solution I put an index hint on the query, and the query is basically instant. However, I try to stay away from index hints when possible. I usually assume that if the query optimizer is unable to do its job, then there is something I can do (or stop doing) to help it without explicitly telling it what to do.  So, why does SQL Server come up with a better plan when I inline the variable? How to delete all files in a current directory starting with a dot? Why is rendered viewport faster than rendering individual frames? When I'm using rendered viewport it initially takes a while before rendering starts, but once it does, I can freely move around and rendering a new view happens almost instantaneously. When on the other hand I'm rendering a movie, for each frame Blender takes a significant amount of time before rendering even starts, usually doing the following:  Synchronizing object, Updating images, Updating meshes, Updating Scene BVH, Packing BVH,  Why does it do this? And is it possible to disable this to increase movie rendering speed? How to measure a qubit Hamiltonian in qiskit How can I disable the purple splash screen at boot? How can I disable the purple "Ubuntu" splash screen that displays at boot before the login screen has loaded? I'd prefer to just see plain text scroll by. First, this is about beta sites that might not even exist later, but imagine they will for the sake of this question. Taking the latest 10 questions on , I see 3 questions related to Mac OS X:    From my point of view, all 3 could also fit on , the 1st one could also be on SO, the 2nd and 3rd could also be on SU. How we will deal with this type of situation? When should we close a question as &quot;Belongs on [...]&quot;? I already see identical questions asked on 2 or 3 different sites (by the same or different users). Is there anything planned to link these questions or something like that? I mean something else than the already existing &quot;Linked&quot; feature. Something to include answers from site X in site Y or something like this. When my phone MOTOROLA G3(2015) is updated to Marshmallow, its not showing files when connected to PC. While connecting, it shows options as charing only, PTP, MTP, MIDI. When I select MTP, it shows the external card, but not showing the contents, where as internal memory is detected and all files are shown. Since I want to protect my ssh connections, I set some global cipher suite options to restrict set of used algorithms. But recently I've encountered a server which doesn't support some of those algorithms. So, I need to selectively enable deprecated algorithms for a specific host record in client (my system) configuration.  I found out that the options override is not working as I expected. Let's take a minimal (not-)working example for the github:  HostKeyAlgorithms ssh-ed25519-cert-v01@openssh.com,ssh-ed25519,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp521,ecdsa-sha2-nistp256  Host github     HostKeyAlgorithms ssh-rsa     Hostname        github.com     Port            22     User            git     PubkeyAuthentication yes     IdentityFile    ~/.ssh/some-filename-here   Having that, I receive the following error (HostKeyAlgorithms is not overriden at all):  debug1: /home/username/.ssh/config line 14: Applying options for github &lt;...&gt; debug2: kex_parse_kexinit: ssh-ed25519-cert-v01@openssh.com,ssh-ed25519,ecdsa-sha2-nistp521-cert-v01@openssh.com,ecdsa-sha2-nistp521,ecdsa-sha2-nistp256 &lt;...&gt; Unable to negotiate with 192.30.252.130: no matching host key type found. Their offer: ssh-dss,ssh-rsa   It is similarly not working for the global PubkeyAuthentication no options with an override in a host configuration.  Also, the match doesn't help either:  match host github     HostKeyAlgorithms ssh-rsa   So, is there a way to selectively redefine those options?  NOTE: I'm using the openssh-7.1_p2-r1 on gentoo.