Mesg: ttyname failed: Inappropriate ioctl for device

#1

Hi there. Using rclone to download my cloud-uploaded Google photos to a hard drive connected to an rPi 2. Everything is working how I want it after clearing up all the duplicates (dedupe rename, noticed a bunch of these on email output that is sent to me). I set a cron job to execute rclone every 30 mins to check for changes. My email output now only shows one line of info:

mesg: ttyname failed: Inappropriate ioctl for device

What does this mean and how can I fix? I ask because I am assuming that if there is no output from the rclone command (eg: no file changes, no new additions, no duplicates), I will not get an email. Rather. I would get an email if there was any output. I hope that makes sense.

0 Likes

#2

What’s the actual script look like? Does the script run by hand?

0 Likes

#3

I get the same output in an ssh window.

My command is:

rclone --ignore-checksum --ignore-existing copy drivephotos:“Google Photos” /sharedfolders/GooglePhotos/afx

0 Likes

#4

What’s the actual prompt command look like?

Can you paste it all in with the error and can use three ` at the beginning of the line to get

commands here

and 3 at the end

0 Likes

#5

I think this is likely something to do with the cron execution environment. This page might help.

0 Likes

#6

Sorry for the late response. When the command is typed into an ssh window, there is no output, but files are downloaded as expected. The ttyname message isn’t displayed.

0 Likes

#7

Usually cron doesn’t keep any part of your environment so you need to use full paths and probably pass a rclone conf file as well.

If you shared exactly what you put in cron, that’s most likely why it’s not working.

An example script that I use in cron.

#!/bin/bash
# RClone Config file
RCLONE_CONFIG=/opt/rclone/rclone.conf
export RCLONE_CONFIG
LOCKFILE="/tmp/`basename $0`"

(
  # Wait for lock for 5 seconds
  flock -x -w 5 200 || exit 1

# Move older local files to the cloud
/usr/bin/rclone move /data/local/ gcrypt: -P --checkers 3 --log-file /opt/rclone/logs/upload.log -v --drive-chunk-size 32M --exclude-from /opt/rclone/scripts/excludes --delete-empty-src-dirs

I set my rclone.conf using an environment variable and I use the full path to rclone.

0 Likes

#8

Actually, I no longer get that message after reading the thread ncw linked. No email this time.

0 Likes

#9

I have one more question. Say if in Google photos I did a small edit on an image (change filter for example) and saved it, can rclone download those changes?

0 Likes

#10

Rclone will download the entire image if it has changed, if that is what you mean?

0 Likes

#11

What did you do to fix it? Posting what the fix was helps other folks that may hit the issue.

0 Likes

#12

Yes. Either as the same file with the updated changes or as a new file.

0 Likes

#13

As mentioned above, I followed the link ncw posted.

0 Likes

#14

Which means you changed what to what to get it working?

0 Likes