=== JanC_ is now known as JanC [11:25] Quick question if anyone is around. I'm trying to create a simple sh script file to remove files in a certain directory on a weekly basis. While it removes the file(s) just fine, it also leave an error output in the console when I run it manually: --> rm: cannot remove 'directory/*': No such file or directory [11:26] With using a simple script line --> rm /directory/* [11:29] Guess I can use -f to ignore it. [12:04] Can someone point me to the right direction how to create a mv script if the file does not exist? [12:05] I tried using "if [ ! -f directory/file ]; then mv directory/file fi" but that doesn't appear to work either. Still same file does not exist error. [12:24] how would you move a file that is not there? can you explain it a different way and by "script" do you mean a "bash script"? [12:25] Skyrider: ^ [12:26] .sh shell script, and would only like to move the file if it exists. [12:35] ok, so IF it exists, then move. [12:37] I saw this one (I think is best)... [ ! -f src ] || mv src dest [12:47] Think I tried that as well before I used if [ ! -f directory/file ]; then mv [12:47] moment ^^ [12:50] Interesting, that worked. Wonder why the if statement didn't. [12:51] odd, i did this verbatim and it worked - [ ! -f del.src ] || mv del.src Documents/ [12:51] maybe you did not understnad, this will not crash a script if the document is not found and will continue, but it will not "try" to move a non-existing document [12:52] i mean it will appear to work whether the doc is there or not, but not throw an exception if no document is there - it will just go to the next line (doing nothing after theh pipe) [12:53] It did work for me as well, but I also found the IF [ -f src ]; then FI statement online, which didn't ^^. [12:53] Making sure it doesn't throw out errors, as systemd timers loves to pop up errors if something fails. [12:53] :D - must be why I did not like it (nor recommend it) - i tested the one I liked before showing you [12:54] to me it is odd, b/c I love/need/hopefor errors - w/o them I can't fix things. [12:58] ^_^ appreciate it btw, thanks :D === nolan__ is now known as nolan_