Software :: Rsync Behaves Differently Under Cron And Under My Normal Environment

Mar 16, 2010

I am making a backup on an ntfs disk, mounted with:

using the following command:

Running this (or rather the shell script containing it) from the command line is OK, but if I run it as a cron job, I get thousands of messages:

(without line breaks, actually).

These files are all ordinary files made under Windows; the above should read "offici�le stukken", and from the command line it does, but not in cron.

I guess I need to set an environment variable, but which one?

View 1 Replies


ADVERTISEMENT

General :: Script Behaves Different In Cron Than From Terminal?

Jul 25, 2011

I have the following bash script...

Code:
#!/bin/bash
#Set filename for links
FILE=/home/andrew/scripts/links.txt
#pkill chrome
pkill firefox

[Code]...

When run it compares the public ip address against a file (ipAddress.txt) to basically determine if I am on my VPN or not. If I am not, i.e. it finds my public ip in the ipAddress.txt file it is supposed to exit otherwise it launches firefox with the given URL.

I have tested this by running from cmd line and running from the crontab. Running from the cmd line I can start the script, let it launch the first URL, then i disconnect from the VPN and the next time it goes through the loop it detects that my VPN has disconnected and kills the script. However, from the cron job if I have disconnected from the vpn I have found that it even though it finds my public ip address within the ipAddress.txt file it still marches right through to the next step in the script and launces the browser and will do this over and over.

View 5 Replies View Related

Ubuntu :: Pysdm Mounts Drives Differently To Normal?

Mar 10, 2011

I have a partition with my firefox profile that when I mount with Pysdm it cannot access. But when I mount normally by right clicking, unmount/mount. I can.

View 5 Replies View Related

Server :: Rsync Fails In Cron - Ssh Key - For Rsync?

Dec 8, 2010

I'm using Ubuntu 10.04 LTS server and Postgresql 8.4. I have a .sh script that is run by cron every other hour. That works fine. The .sh script includes an rsync command that copies a postgresql dump .tar file to a remote archive location via ssh. That fails when run by cron; I think because it is (quietly) asking for the remote user's password (and not getting it). I set up the public/private ssh key arrangement. The script succeeds when run manually as the same user that the cron job uses, and does not ask for the password. I am able to ssh to the remote server from the source server (using the same username) and not get the password prompt (both directions), so why doesn't rsync work? I even put a .pgpass file in the root of that user's directory with that user's password, and the user/password are identical on both servers.

I think the problem is rsync is not able to use the ssh key correctly. I tried adding this to my script but it didn't help.

Code:

Here is the rsync command embedding in the .sh script.

Code:

Here is the cron entry:

Code:

View 6 Replies View Related

Ubuntu :: Way To Run CRON Job For Something That 'normal' Users Need To Run As SUDO?

Jun 5, 2010

As per subject, what's the best way to run a CRON job for something that "normal" users need to run as SUDO? There is a problem with the internal clock on my PC so at a regular time (every hour or day for example) I want to sync with my Network Time server. I use "sudo ntpdate time.bgr.local" as it is now and have to enter my user's password for it to work.I know root is disabled by default and would like to keep it that way if possible but if I have to enable it and then add it to root's cron list the so be it but would prefer not to.

View 5 Replies View Related

Ubuntu Servers :: Cron Will Not Run Rsync Job

Mar 30, 2011

I am running a headless Ubuntu server accessed through Webmin. The server is running 10.4.2 64 bit version. I have a number of cron jobs including a simple back-up job which is:
Code:
rsync -av /media/server/ /media/backup/backup/
All of the other jobs run fine but for some reason this job which is scheduled to run each day at midnight does not run. If I SSH into the server and run the job manually it works fine.

The output of 'crontab -l' is:
@daily rsync -av /media/server/ /media/backup/backup/
11 3 * * * /etc/webmin/package-updates/update.pl
@daily tar czf /media/backup/serversystem.bz2 --exclude=/proc --exclude=/lost+found --exclude=/backup.tar.bz2 --exclude=/mnt --exclude=/media --exclude=/sys /
@reboot inadyn --username ********** --password ********** --update_period_sec 600 --alias **********
@daily /etc/webmin/backup-config/backup.pl 12978522112842

The output of 'crontab -e' is:
Error opening terminal: unknown.
crontab: "/usr/bin/sensible-editor" exited with status 1

View 9 Replies View Related

Server :: Using Rsync With Cron On Different Port?

Nov 14, 2010

I'm trying to set-up a cron job that uses rsync to transfer back files from a remote server. ssh on the remote server is running on port 12345 but this seems to be a problem. My script looks like this:

Code:
#!/bin/sh
RSYNC=/usr/bin/rsync
SSH=/usr/bin/ssh
KEY=/home/username/.ssh/id_rsa.pub

[Code]...

View 6 Replies View Related

Security :: Lots Of CRON Spam From Root. Normal?

Jan 25, 2010

Take a peek at this:

Code:
Jan 23 20:15:01 localhost CRON[22629]: pam_unix(cron:session): session opened for user root by (uid=0)
Jan 23 20:15:01 localhost CRON[22629]: pam_unix(cron:session): session closed for user root

[code]....

View 3 Replies View Related

Ubuntu :: Rsync Bash Script Different In Cron?

Feb 19, 2010

I've got a bash script that uses rsync via SSH to back up data from a remote webserver.
This script works fine when I run it myself but when it runs as a cron job I get the following error:

Code:
2010/02/20 08:15:01 [6786] Unexpected remote arg: user@www.server.com:~/www
2010/02/20 08:15:01 [6786] rsync error: syntax or usage error (code 1) at main.c(1219)

[code]....

View 9 Replies View Related

Ubuntu :: Rsync Sh File Don't Work With Cron

Mar 25, 2011

I have a backup sh file that I have been using for a long time. It has always worked. 2 Days back I switched to a different pc and now suddenly the script don't work.If I run it manually in the terminal it works. But when it execute with cron it doesn't copy any files to the backup destination. It starts but doesn't copy anything.Can someone help me as to why it works manually but not with cron ?

View 9 Replies View Related

Ubuntu :: My Desktop Environment Wont Start In Normal Mode

Jan 8, 2011

I get a blank screen with no progress when I use normal mode, but I am able to get into desktop environment using recovery mode and selecting safe graphics mode from there. Anything I could to do to restore my normal desktop environment.

View 9 Replies View Related

General :: How Can Interactive Login Environment Be Duplicated In Cron

May 24, 2010

My execution environment is Linux steamboy 2.6.31-21-generic-pae #59-Ubuntu SMP.If I log in and run a program, the program works properly. The program is a shell script, which executes an environment file, so that path and library settings point correctly.If I have cron run the same program as the same user who logged in, one of the libraries cannot be found. I have sourced .bashrc and the same environment setting file, even though .bashrc executes the same environment file . /home/amr/bin/informix_env.sh

View 1 Replies View Related

General :: Difference Between Cron And Command Line Environment?

Feb 18, 2010

so i have a few shell scripts that execute wonderfully when i type them at the command line but they fail when they are run from cron.

for example, if i run a script from command line that contains

Code:
shopt -s nullglob

to prevent problems with for f in *.mp4 type loops, it works fine from terminal command line but when called from cron, it gives an error->

Code:
/home/centralsqwall/Videos/videochecker.sh: 91: shopt: not found

a couple other random errors as well...

so there is some difference in the shell from cron and the terminal?

i'm running ubuntu 9.10, #!/bin/bash

what are the commands i should be using to echo my environment or simulate cron environment from the terminal?

View 3 Replies View Related

OpenSUSE :: Backup Important Files - Automate The Process Using Rsync And Cron

Aug 14, 2011

I would like to backup important files (totaling about 400GB) on my ext 4 RAID 5 array to an ext4 external hard drive over USB (external drive is mounted to /mnt. In the future I'd like to automate the process using rsync and cron so for now I'm using rsync to transfer the files. My problem is that using the rsync command like this: # rsync -Pr "/dir1" "/dir2" "/dir3" "/dir4" /mnt

rsync shows me the checks and transfers for awhile and then throws up an i/o error (wish I had a screenshot to show but I don't). When I ls /mnt I get a similar i/o error. I then check /dev for the drive and find that it no longer shows up. Originally the partition was /dev/sdc1. I tried unplugging the USB at this point, plugging it back in and mounting the drive back to /mnt, however it has now assigned it to (you guessed it) /dev/sdd1. I get the drive mounted and try the original rsync command again, hoping the first error was a fluke or some kind of one-time drive fart. This time it makes it quite a bit further and then throws up the exact same problem. Am I doing something terribly wrong here? As I said, I'm very new to bash so I'm not making some absolutely moronic, newbie mistake.

View 9 Replies View Related

Programming :: Loading Environment Into Bash Script Called By Cron?

Mar 18, 2010

Script programming question for the experts. I have written a bash script that works fine if I execute from the shell interactively. However, once I schedule it to be executed via cron, it just wouldn't work. I believe this has to do with cron running in a different environment than the one I am in when I putty in.

The bash shell script does refer to environment variables in the .cshrc file. I guess these aren't available to the cron? How can I load them into the script if I want them to be available to the cron locally within the script?

View 1 Replies View Related

Ubuntu :: Acpid Behaves Strangely On Tablet

Oct 19, 2010

I have followed this guide to setup automatic screen rotation on a fresh installation of Maverick on a Lenovo X200t. This involves creating the file:

Code:
$cat /etc/acpi/events/x200t-swivel-down
# /etc/acpi/events/x200t-swivel-down
# called when tablet head swivels down
event=ibm/hotkey HKEY 00000080 00005009
action=/etc/acpi/x200t-swivel-down.sh
and the script

Code:
$cat /etc/acpi/x200t-swivel-down.sh
#!/bin/sh
/usr/bin/xrandr -o inverted
touch /home/nikos/Desktop/swivel-down
xsetwacom set "Serial Wacom Tablet stylus" Rotate half
xsetwacom set "Serial Wacom Tablet touch" Rotate half
xsetwacom set "Serial Wacom Tablet eraser" Rotate half
(similar for swivel-up)

What I find strange:
- calling the script with ./x200t-swivel-down.sh works (both with and without sudo).
- rotating the screen to tablet mode only executes the touch commands (which I entered for debugging)

Obviously, the acpi event is registered correctly and reacted upon. Just why are the xrandr and xsetwacom commands ignored?

View 3 Replies View Related

Ubuntu :: System Behaves Strangely Whenever I Log In Via Fingerprint Reader (AES2501) / What To Do?

Jun 12, 2010

I've recently noticed that whenever I log in via fingerprint reader (AES2501), my system behaves strangely.
For example, the Gnome panels take almost a full minute to appear after everything else has been loaded, and there's no NetworkManager icon in the panel - even though nm-applet (and thus NetworkManager) is running as shown by top; that can be (partially) solved by killing NetworkManager, restarting dbus, and then manually running NetworkManager.
None of that happens when logging in using a password.

Short of not using my fingerprint reader, what can I do?

View 3 Replies View Related

General :: Why Does Sha1sum Act Differently With The Same Input

Jun 22, 2010

I'm trying to replicate the behavior of the sha1sum executable in some java code, however, in the process I've discovered that sha1sum appears to behave differently given the same input in two scenarios.

Assume input of '12345' without the single quotes and with no newline.

If I put this data into a file (file1) and run sha1sum from the command line:

However, if I do this, I get a different result:

Using the apache commons-codec jar, I'm able to read in file1, get it's contents, and perform a .shahex() on the content and get the first result. However, I need to get the second result (due to legacy code) and I can't figure out why sha1sum is behaving differently, or what grep is doing to the input.

The system is running CentOS 5.4 with sha1sum 5.97

View 3 Replies View Related

Slackware :: Do FF & SM Render Fonts Differently

Jan 28, 2011

Some time ago I optimised my fonts following dugan's great tutorial. I mostly used Seamonkey to browse so I didn't notice the difference until today I ran Firefox. The font preferences seem to be identical, yet the fonts look differently on each browser. See the attachments (the browser on the left-hand side is Seamonkey)

View 2 Replies View Related

Ubuntu Security :: Md5 In Terminal Hashes Differently Than PHP?

Jan 16, 2010

I'm trying to generate MD5 hashtext within gnome-terminal that will match that generated by PHP running on a live web server. However, when I hash the same text I get completely different results!

Code:
<?php md5('testing123') ?> ===> 7f2ababa423061c509f4923dd04b6cf1
bash$ echo 'testing123' | openssl md5 ===> bad9425ff652b1bd52b49720abecf0ba

Could this be a character set problem? My terminal is running UTF-8, but even if I change it to ISO-8859-1, the hashtext that's generated is the same. Also tried using md5sum with a text file, saved in various character encodings, but still got the same [wrong] hashtext. I'm running Ubuntu 9.10, tried running the local hash in both gnome-terminal 2.28.1 and the CTRL+ALT+F1 console.

View 2 Replies View Related

Ubuntu :: Does KDE Work Differently / Can Different Xserver Be Cause Of KDE Not Working

May 29, 2010

Now I tried installing the KDE destop enviremont, the install went just fine but when I try to log into KDE I see the startup screen for a second then everything goes dark.It stays that way in the background i think the desktop is there because the mouse cursor is there, I can move it around but that's all.Does KDE work differently and so can the different xserver be the cause of KDE not working?

View 5 Replies View Related

Ubuntu :: Plugin Treats Pdf Files Differently?

Jul 5, 2010

I have plugins for viewing pdf files in both Opera and Firefox. Most pdf files opens embedded in the browser, just as I want. But there is some pdf files I am prompted to save before I can open, just as if the pdf is not recognized as a pdf ? A closer look shows that this pdf's are made using pdf-printers, drawing programs and other non-Adobe programs. It probably misses some Mime coding or other things that Adobe distiller puts into native pdf's ? How can I make the browser/system/plugin/acroread only care about the extension, and not the creator ?

View 2 Replies View Related

Red Hat / Fedora :: Label Being Displayed Differently In KDE/Gnome

Mar 23, 2010

So I ran a software in both KDE and Gnome respectively and it seems both of them have separate displays. By that I mean, one is displaying a part of the string(a Label) and the other is not displaying the string at all. I will include some relevant information such as the software uses SWT kit. Also the string is displayed perfect in Windows. If it's still not clear I will sum it up in a sentence. I am trying to display a label using SWT kit and, its being displayed correctly on Windows,partially correct on KDE(Half of the string) and not displayed on Gnome.

I have tried GridDat.grabExcessHorizontalSpace=true, but it didn't. how to approach the problem otherwise?

View 3 Replies View Related

Programming :: Init Script Differently When Run On Machines In The UK Vs US?

Jul 19, 2011

I have an initscript that behaves slightly differently in the UK than it does in the US. Not a huge issue, but I'd like to know why and how to fix it. I imagine it has something to do with localization, but I'm at a loss as to what it could be, as it's just bash.

in the UK:
Code:
[root@server ~]# /etc/init.d/worker
status}
in the US:

[Code]...

View 6 Replies View Related

Ubuntu Servers :: Advanced Rsync - Make The Rsync Set Or Keep The User And Group Affiliations?

Nov 17, 2010

Thought I'd post it here because it's more server related than desktop... I have a script that does:

[Code]....

This is used to sync my local development snapshot with the live web server. There has to be a more compact way of doing this? Can I combine some of the rsyncs? Can I make the rsync set or keep the user and group affiliations? Can I exclude .* yet include .htaccess?

View 6 Replies View Related

Ubuntu :: Can't Rsync Gmail / Run Rsync --recursive --times --perms --links --delete?

Jan 7, 2011

When I run rsync --recursive --times --perms --links --delete --exclude-from='Documents/exclude.txt' ./ /media/myusb/

where Documents/exclude.txt is

- /Downloads/
- /Desktop/books/

the files in those directories are still copied onto my USB.

And...

I used fetchmail to download all my gmail emails. When I run rsync -ar --exclude-from='/home/xtheunknown0/Documents/exclude.txt' ./ /media/myusb/ I get the first image at url.

View 9 Replies View Related

Server :: Rsync Execution - With Crontab - Have Given Full Path To Rsync Too

Apr 12, 2011

I have a tiny shell script to rsync files between two servers and remove the source files.

This script works fine, when it has been initiated manually or even when the rsync command is executed on the command line.

But the same script doesn't work, when I try to automate it through crontab.

I am using 'abc' user to execute this rsync, instead of root, as root login to servers are restricted in all of our servers, by us.

As I mentioned earlier, manual execution works like charm!

When this rsync.sh is initiated through crontab, it runs the first command(chown abc.abc ...) perfectly without any issues. But the second line is not at all executed, and there is no log entry i can find at /mnt/xyz/folder/rsync.log.

View 6 Replies View Related

Software :: Run Rsync To Download Files From A Server Without Rsync Daemon?

Sep 18, 2009

I just tried to sync files from one server to another. After the sync process, I found the files are bigger than original ones.

I looked up the web and found someone mentions the rsync daemon. So I have to run the daemon on one server before I run the rsync?

The command I used is rsync --partial --progress -r source destination

View 1 Replies View Related

Ubuntu Servers :: Cron Sending Email From Address / Change The Default Domain Name For Cron?

Apr 29, 2011

Can anyone tell me how i change the default domain name for cron?everything i cron runs it emails from and to user@com.com

this leaves me with a massive list of failed mails in postfix.i have mailto on my main crontab but i cant do it on all of them.

View 1 Replies View Related

Slackware :: Firefox Showing Pages Differently To Other Platforms?

May 14, 2010

The scrollbars you see around the form do not show up on Firefox on Mac or Windows, and don't show up in Opera.Why is Firefox on Slack displaying pages in a slightly different manner?

View 14 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved