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.
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.
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.
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.
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.
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: 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
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:
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 ?
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.
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
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.
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?
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?
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?
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
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)
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!
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.
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?
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 ?
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?
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:
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?
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.
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.
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?